| Qore Programming Language Reference Manual 2.2.0

Loading...
Searching...
No Matches
QC_FtpClient.dox.h
1
3 namespace Qore {
5
7 struct FtpResponseInfo {
9 int code;
11 string msg;
12};
13}
14
16 namespace Qore {
18
98 class FtpClient {
99
100 public:
102
111 clearStats();
112
113 public:
115
124nothing clearWarningQueue();
125
126 public:
128
145nothing connect();
146
147 public:
149
154 constructor();
155
156 public:
158
170 constructor(string url);
171
172 public:
174
176 copy();
177
178 public:
180
193nothing cwd(string path);
194
195 public:
197
212nothing del(string remote_path);
213
214 public:
216
224 destructor();
225
226 public:
228
236nothing disconnect();
237
238 public:
240
264nothing get(string remote_path, *string local_path);
265
266 public:
268
288nothing get(string remote_path, Qore::OutputStream os);
289
290 public:
292
312 binary getAsBinary(string remote_path);
313
314 public:
316
340 string getAsString(string remote_path, *string encoding);
341
342 public:
344
360 hash<auto> getControlPeerInfo(bool host_lookup = True);
361
362 public:
364
380 hash<auto> getControlSocketInfo(bool host_lookup = True);
381
382 public:
384
400 hash<auto> getDataPeerInfo(bool host_lookup = True);
401
402 public:
404
420 hash<auto> getDataSocketInfo(bool host_lookup = True);
421
422 public:
424
431*string getHostName();
432
433 public:
435
445 string getMode();
446
447 public:
449
461 int getNetworkFamily();
462
463 public:
465
472*string getPassword();
473
474 public:
476
483 int getPort();
484
485 public:
487
498*string getSSLCipherName();
499
500 public:
502
513*string getSSLCipherVersion();
514
515 public:
517
524 int getTimeout();
525
526 public:
528
535 string getURL();
536
537 public:
539
560 hash getUsageInfo();
561
562 public:
564
571*string getUserName();
572
573 public:
575
579 bool isConnected();
580
581 public:
583
594 bool isDataSecure();
595
596 public:
598
608 bool isSecure();
609
610 public:
612
629*string list();
630
631 public:
633
652*string list(string path);
653
654 public:
656
671nothing mkdir(string remote_path);
672
673 public:
675
692*string nlst();
693
694 public:
696
715*string nlst(string path);
716
717 public:
719
742nothing put(string local_path, *string remote_path);
743
744 public:
746
766nothing put(Qore::InputStream is, string remote_path);
767
768 public:
770
786nothing putData(string data, string remote_path);
787
788 public:
790
806nothing putData(binary data, string remote_path);
807
808 public:
810
825 string pwd();
826
827 public:
829
845nothing rename(string from, string to);
846
847 public:
849
864nothing rmdir(string remote_path);
865
866 public:
868
877 hash<FtpResponseInfo> sendControlMessage(string cmd, string arg);
878
879 public:
881
886nothing setControlEventQueue();
887
888 public:
890
905nothing setControlEventQueue(Qore::Thread::Queue queue, auto arg, *bool with_data);
906
907 public:
909
914nothing setDataEventQueue();
915
916 public:
918
933nothing setDataEventQueue(Qore::Thread::Queue queue, auto arg, *bool with_data);
934
935 public:
937
942nothing setEventQueue();
943
944 public:
946
961nothing setEventQueue(Qore::Thread::Queue queue, auto arg, *bool with_data);
962
963 public:
965
972nothing setHostName(string host);
973
974 public:
976
983nothing setInsecure();
984
985 public:
987
995nothing setInsecureData();
996
997 public:
999
1004nothing setModeAuto();
1005
1006 public:
1008
1013nothing setModeEPSV();
1014
1015 public:
1017
1022nothing setModePASV();
1023
1024 public:
1026
1031nothing setModePORT();
1032
1033 public:
1035
1046nothing setNetworkFamily(int family);
1047
1048 public:
1050
1057nothing setPassword(string pass);
1058
1059 public:
1061
1070nothing setPort(int port);
1071
1072 public:
1074
1083nothing setSecure(bool secure = True);
1084
1085 public:
1087
1091 setTimeout(timeout timeout_ms);
1092
1093 public:
1095
1107nothing setURL(string url);
1108
1109 public:
1111
1118nothing setUserName(string user);
1119
1120 public:
1122
1154nothing setWarningQueue(int warning_ms, int warning_bs, Queue queue, auto arg, timeout min_ms = 1s);
1155
1156 public:
1158
1169*string verifyPeerCertificate();
1170};
1171}
Qore::FtpClient
The FtpClient class allows Qore code to communicate with FTP servers with the FTP and FTPS protocols.
Definition QC_FtpClient.dox.h:98
Qore::FtpClient::setTimeout
setTimeout(timeout timeout_ms)
sets the socket I/O timeout value in milliseconds
Qore::FtpClient::setSecure
nothing setSecure(bool secure=True)
Make an FTPS connection to the server on the next connect if the argument is True.
Qore::FtpClient::setEventQueue
nothing setEventQueue()
Clears any Queue object that may be set on the FtpClient object so that I/O events are no longer capt...
Qore::FtpClient::setUserName
nothing setUserName(string user)
Sets the user name to use for the next connection.
Qore::FtpClient::clearStats
clearStats()
Clears performance statistics.
Qore::FtpClient::setEventQueue
nothing setEventQueue(Qore::Thread::Queue queue, auto arg, *bool with_data)
Sets a Queue object to receive FtpClient and Socket events on both the data and control connections.
Qore::FtpClient::setModePASV
nothing setModePASV()
Sets the object to only try to make data connections using PASV (RFC-959 passive) mode.
Qore::FtpClient::setNetworkFamily
nothing setNetworkFamily(int family)
Sets the network address family to use for new connections; use this method to restrict connections t...
Qore::FtpClient::list
*string list()
Returns a list of files from the FTP server in the server's long format in the current working direct...
Qore::FtpClient::getNetworkFamily
int getNetworkFamily()
Returns the network address family to use for new connections.
Qore::FtpClient::get
nothing get(string remote_path, *string local_path)
Gets a file from the FTP server and stores it on the local filesystem; if any errors occur,...
Qore::FtpClient::isDataSecure
bool isDataSecure()
Returns True if the data connections are secure TLS/SSL connections, False if not.
Qore::FtpClient::putData
nothing putData(binary data, string remote_path)
Transfers binary data to the FTP server and saves it as a file on the remote machine; if any errors o...
Qore::FtpClient::getURL
string getURL()
Retrieves the current connection URL string for this object.
Qore::FtpClient::clearWarningQueue
nothing clearWarningQueue()
Removes any warning Queue object from the Socket.
Qore::FtpClient::constructor
constructor(string url)
Creates an FtpClient object and initializes it with a URL.
Qore::FtpClient::getSSLCipherVersion
*string getSSLCipherVersion()
Returns the version of the cipher for an encrypted connection or NOTHING if an encrypted connection i...
Qore::FtpClient::setWarningQueue
nothing setWarningQueue(int warning_ms, int warning_bs, Queue queue, auto arg, timeout min_ms=1s)
Sets a Queue object to receive socket warnings.
Qore::FtpClient::sendControlMessage
hash< FtpResponseInfo > sendControlMessage(string cmd, string arg)
Sends a message on the control connection with a reply on the control connection only.
Qore::FtpClient::getUserName
*string getUserName()
Returns the current username value or NOTHING if none is set.
Qore::FtpClient::pwd
string pwd()
Returns the server-side current working directory.
Qore::FtpClient::setURL
nothing setURL(string url)
Sets the connection and login parameters based on the URL passed as an argument.
Qore::FtpClient::getControlSocketInfo
hash< auto > getControlSocketInfo(bool host_lookup=True)
Returns information about the local control socket as a hash.
Qore::FtpClient::copy
copy()
Throws an exception to prevent copying of objects this class.
Qore::FtpClient::setDataEventQueue
nothing setDataEventQueue(Qore::Thread::Queue queue, auto arg, *bool with_data)
Sets a Queue object to receive FtpClient and Socket events on the data connection.
Qore::FtpClient::getAsString
string getAsString(string remote_path, *string encoding)
Gets a file from the FTP server and returns it as a string.
Qore::FtpClient::setDataEventQueue
nothing setDataEventQueue()
Clears any Queue object that may be set on the FtpClient object so that I/O events are no longer capt...
Qore::FtpClient::getAsBinary
binary getAsBinary(string remote_path)
Gets a file from the FTP server and returns it as a binary.
Qore::FtpClient::setInsecureData
nothing setInsecureData()
Make a non-encrypted data connection to the server on the next connect even if the control connection...
Qore::FtpClient::getDataSocketInfo
hash< auto > getDataSocketInfo(bool host_lookup=True)
Returns information about the local data socket as a hash.
Qore::FtpClient::nlst
*string nlst(string path)
Returns a list of file names from the FTP server for the given path or NOTHING if the path cannot be ...
Qore::FtpClient::getPort
int getPort()
Retrieves the current connection port value for this object.
Qore::FtpClient::disconnect
nothing disconnect()
Disconnects from an FTP server.
Qore::FtpClient::verifyPeerCertificate
*string verifyPeerCertificate()
Returns a string code giving the result of verifying the remote certificate or NOTHING if an encrypte...
Qore::FtpClient::put
nothing put(string local_path, *string remote_path)
Transfers a local file to the FTP server; if any errors occur, an exception is thrown.
Qore::FtpClient::getUsageInfo
hash getUsageInfo()
Returns performance statistics for the socket.
Qore::FtpClient::mkdir
nothing mkdir(string remote_path)
Creates a directory on the FTP server; if any errors occur, an exception is thrown.
Qore::FtpClient::setControlEventQueue
nothing setControlEventQueue()
Clears any Queue object that may be set on the FtpClient object so that I/O events are no longer capt...
Qore::FtpClient::get
nothing get(string remote_path, Qore::OutputStream os)
Gets a file from the FTP server and writes it to an OutputStream; if any errors occur,...
Qore::FtpClient::setModeEPSV
nothing setModeEPSV()
Sets the object to only try to make data connections using EPSV (RFC-2428 extended passive) mode.
Qore::FtpClient::nlst
*string nlst()
Returns a list of file names from the FTP server in the current working directory or NOTHING if the p...
Qore::FtpClient::del
nothing del(string remote_path)
Deletes a file from the FTP server; if any errors occur, an exception is thrown.
Qore::FtpClient::setPort
nothing setPort(int port)
Sets the control port value to use for the next connection (the FTP protocol default is 21)
Qore::FtpClient::destructor
destructor()
Disconnects any remote connection and destroys the object.
Qore::FtpClient::isConnected
bool isConnected()
Returns True if the client is connected to the server.
Qore::FtpClient::getControlPeerInfo
hash< auto > getControlPeerInfo(bool host_lookup=True)
Returns information about the remote end of the control socket as a hash.
Qore::FtpClient::setHostName
nothing setHostName(string host)
Sets the hostname or address to use to connect to for the next connection.
Qore::FtpClient::getMode
string getMode()
returns a string for the connection mode: "port", "pasv", "epsv", or "auto" if not connected and auto...
Qore::FtpClient::rmdir
nothing rmdir(string remote_path)
Removes a directory on the remote FTP server; if any errors occur, an exception is thrown.
Qore::FtpClient::put
nothing put(Qore::InputStream is, string remote_path)
Transfers the content of an InputStream to the FTP server; if any errors occur, an exception is throw...
Qore::FtpClient::getTimeout
int getTimeout()
returns the socket I/O timeout value as an integer in milliseconds
Qore::FtpClient::rename
nothing rename(string from, string to)
Renames/moves a file or directory; if any errors occur, an exception is thrown.
Qore::FtpClient::setModeAuto
nothing setModeAuto()
Sets the object to automatically try to negotiate the data connections in EPSV, PASV,...
Qore::FtpClient::isSecure
bool isSecure()
Returns True if the control connection is a secure TLS/SSL connection, False if not.
Qore::FtpClient::list
*string list(string path)
Returns a list of files from the FTP server in the server's long format for the given path or NOTHING...
Qore::FtpClient::getSSLCipherName
*string getSSLCipherName()
Returns the name of the cipher for an encrypted connection or NOTHING if an encrypted connection is n...
Qore::FtpClient::getPassword
*string getPassword()
Returns the current password value or NOTHING if none is set.
Qore::FtpClient::setInsecure
nothing setInsecure()
Make a non-encrypted connection to the server on the next connect.
Qore::FtpClient::getDataPeerInfo
hash< auto > getDataPeerInfo(bool host_lookup=True)
Returns information about the remote data socket as a hash.
Qore::FtpClient::setControlEventQueue
nothing setControlEventQueue(Qore::Thread::Queue queue, auto arg, *bool with_data)
Sets a Queue object to receive FtpClient and Socket events on the control connection.
Qore::FtpClient::setModePORT
nothing setModePORT()
Sets the object to only try to make data connections using PORT mode.
Qore::FtpClient::putData
nothing putData(string data, string remote_path)
Transfers string data to the FTP server and saves it as a file on the remote machine; if any errors o...
Qore::FtpClient::connect
nothing connect()
Connects to the FTP server and attempts a login; if any errors occur, an exception is thrown.
Qore::FtpClient::getHostName
*string getHostName()
Returns the current hostname value or NOTHING if none is set.
Qore::FtpClient::cwd
nothing cwd(string path)
Changes the current working directory on the server.
Qore::FtpClient::setPassword
nothing setPassword(string pass)
Sets the password to use for the next connection.
Qore::FtpClient::constructor
constructor()
Creates an empty FtpClient object.
Qore::InputStream
This class defines an abstract interface for input streams.
Definition QC_InputStream.dox.h:19
Qore::OutputStream
This class defines an abstract interface for output streams.
Definition QC_OutputStream.dox.h:18
Qore::Thread::Queue
Queue objects provide a blocking, thread-safe message-passing object to Qore programs
Definition QC_Queue.dox.h:22
Qore::True
const True
logical True
Definition qc_qore.dox.h:98
Qore::hash
hash< auto > hash(object obj)
Returns a hash of an object's members.
Qore::binary
binary binary()
Always returns an empty binary object (of zero length)
Qore
main Qore-language namespace
Definition Pseudo_QC_All.dox.h:3
Qore::FtpResponseInfo
A hash describing a free-form FTP control response.
Definition QC_FtpClient.dox.h:7
Qore::FtpResponseInfo::msg
string msg
The response message string.
Definition QC_FtpClient.dox.h:11
Qore::FtpResponseInfo::code
int code
The integer response code.
Definition QC_FtpClient.dox.h:9