Qore Programming Language Reference Manual  0.9.4
QC_FtpClient.dox.h
1 
3 namespace Qore {
5 
9  int code;
11  string msg;
12 };
13 }
14 
16 namespace Qore {
18 
96 class FtpClient {
97 
98 public:
100 
109  clearStats();
110 
111 public:
113 
122 nothing clearWarningQueue();
123 
124 public:
126 
143 nothing connect();
144 
145 public:
147 
152  constructor();
153 
154 public:
156 
168  constructor(string url);
169 
170 public:
172 
174  copy();
175 
176 public:
178 
191 nothing cwd(string path);
192 
193 public:
195 
210 nothing del(string remote_path);
211 
212 public:
214 
222  destructor();
223 
224 public:
226 
234 nothing disconnect();
235 
236 public:
238 
262 nothing get(string remote_path, *string local_path);
263 
264 public:
266 
286 nothing get(string remote_path, Qore::OutputStream os);
287 
288 public:
290 
310 binary getAsBinary(string remote_path);
311 
312 public:
314 
334 string getAsString(string remote_path);
335 
336 public:
338 
354 hash<auto> getControlPeerInfo(bool host_lookup = True);
355 
356 public:
358 
374 hash<auto> getControlSocketInfo(bool host_lookup = True);
375 
376 public:
378 
394 hash<auto> getDataPeerInfo(bool host_lookup = True);
395 
396 public:
398 
414 hash<auto> getDataSocketInfo(bool host_lookup = True);
415 
416 public:
418 
425 *string getHostName();
426 
427 public:
429 
439 string getMode();
440 
441 public:
443 
455 int getNetworkFamily();
456 
457 public:
459 
466 *string getPassword();
467 
468 public:
470 
477 int getPort();
478 
479 public:
481 
492 *string getSSLCipherName();
493 
494 public:
496 
507 *string getSSLCipherVersion();
508 
509 public:
511 
518 int getTimeout();
519 
520 public:
522 
529 string getURL();
530 
531 public:
533 
555 
556 public:
558 
565 *string getUserName();
566 
567 public:
569 
580 bool isDataSecure();
581 
582 public:
584 
594 bool isSecure();
595 
596 public:
598 
615 *string list();
616 
617 public:
619 
638 *string list(string path);
639 
640 public:
642 
657 nothing mkdir(string remote_path);
658 
659 public:
661 
678 *string nlst();
679 
680 public:
682 
701 *string nlst(string path);
702 
703 public:
705 
728 nothing put(string local_path, *string remote_path);
729 
730 public:
732 
752 nothing put(Qore::InputStream is, string remote_path);
753 
754 public:
756 
772 nothing putData(string data, string remote_path);
773 
774 public:
776 
792 nothing putData(binary data, string remote_path);
793 
794 public:
796 
811 string pwd();
812 
813 public:
815 
831 nothing rename(string from, string to);
832 
833 public:
835 
850 nothing rmdir(string remote_path);
851 
852 public:
854 
863 hash<FtpResponseInfo> sendControlMessage(string cmd, string arg);
864 
865 public:
867 
872 nothing setControlEventQueue();
873 
874 public:
876 
891 nothing setControlEventQueue(Qore::Thread::Queue queue, auto arg, *bool with_data);
892 
893 public:
895 
900 nothing setDataEventQueue();
901 
902 public:
904 
919 nothing setDataEventQueue(Qore::Thread::Queue queue, auto arg, *bool with_data);
920 
921 public:
923 
928 nothing setEventQueue();
929 
930 public:
932 
947 nothing setEventQueue(Qore::Thread::Queue queue, auto arg, *bool with_data);
948 
949 public:
951 
958 nothing setHostName(string host);
959 
960 public:
962 
969 nothing setInsecure();
970 
971 public:
973 
981 nothing setInsecureData();
982 
983 public:
985 
990 nothing setModeAuto();
991 
992 public:
994 
999 nothing setModeEPSV();
1000 
1001 public:
1003 
1008 nothing setModePASV();
1009 
1010 public:
1012 
1017 nothing setModePORT();
1018 
1019 public:
1021 
1032 nothing setNetworkFamily(int family);
1033 
1034 public:
1036 
1043 nothing setPassword(string pass);
1044 
1045 public:
1047 
1056 nothing setPort(int port);
1057 
1058 public:
1060 
1069 nothing setSecure(bool secure = True);
1070 
1071 public:
1073 
1077  setTimeout(timeout timeout_ms);
1078 
1079 public:
1081 
1093 nothing setURL(string url);
1094 
1095 public:
1097 
1104 nothing setUserName(string user);
1105 
1106 public:
1108 
1140 nothing setWarningQueue(int warning_ms, int warning_bs, Queue queue, auto arg, timeout min_ms = 1s);
1141 
1142 public:
1144 
1155 *string verifyPeerCertificate();
1156 };
1157 }
nothing setControlEventQueue()
Clears any Queue object that may be set on the FtpClient object so that I/O events are no longer capt...
int getNetworkFamily()
Returns the network address family to use for new connections.
string getURL()
Retrieves the current connection URL string for this object.
copy()
Throws an exception to prevent copying of objects this class.
nothing setModeEPSV()
Sets the object to only try to make data connections using EPSV (RFC-2428 extended passive) mode.
*string nlst()
Returns a list of file names from the FTP server in the current working directory or NOTHING if the p...
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,...
hash< auto > getControlSocketInfo(bool host_lookup=True)
Returns information about the local control socket as a hash.
nothing disconnect()
Disconnects from an FTP server.
nothing setHostName(string host)
Sets the hostname or address to use to connect to for the next connection.
nothing setModePASV()
Sets the object to only try to make data connections using PASV (RFC-959 passive) mode.
hash< FtpResponseInfo > sendControlMessage(string cmd, string arg)
Sends a message on the control connection with a reply on the control connection only.
setTimeout(timeout timeout_ms)
sets the socket I/O timeout value in milliseconds
const True
logical True
Definition: qc_qore.dox.h:98
nothing setSecure(bool secure=True)
Make an FTPS connection to the server on the next connect if the argument is True.
*string getSSLCipherVersion()
Returns the version of the cipher for an encrypted connection or NOTHING if an encrypted connection i...
binary binary()
Always returns an empty binary object (of zero length)
The FtpClient class allows Qore code to communicate with FTP servers with the FTP and FTPS protocols.
Definition: QC_FtpClient.dox.h:96
hash< auto > getDataSocketInfo(bool host_lookup=True)
Returns information about the local data socket as a hash.
*string getSSLCipherName()
Returns the name of the cipher for an encrypted connection or NOTHING if an encrypted connection is n...
int getTimeout()
returns the socket I/O timeout value as an integer in milliseconds
A hash describing a free-form FTP control response.
Definition: QC_FtpClient.dox.h:7
nothing rmdir(string remote_path)
Removes a directory on the remote FTP server; if any errors occur, an exception is thrown.
hash< auto > getControlPeerInfo(bool host_lookup=True)
Returns information about the remote end of the control socket as a hash.
nothing clearWarningQueue()
Removes any warning Queue object from the Socket.
nothing setEventQueue()
Clears any Queue object that may be set on the FtpClient object so that I/O events are no longer capt...
nothing connect()
Connects to the FTP server and attempts a login; if any errors occur, an exception is thrown.
nothing setModePORT()
Sets the object to only try to make data connections using PORT mode.
string pwd()
Returns the server-side current working directory.
*string list()
Returns a list of files from the FTP server in the server's long format in the current working direct...
This class defines an abstract interface for output streams.
Definition: QC_OutputStream.dox.h:18
clearStats()
Clears performance statistics.
nothing setNetworkFamily(int family)
Sets the network address family to use for new connections; use this method to restrict connections t...
*string verifyPeerCertificate()
Returns a string code giving the result of verifying the remote certificate or NOTHING if an encrypte...
string getMode()
returns a string for the connection mode: "port", "pasv", "epsv", or "auto" if not connected and auto...
*string getPassword()
Returns the current password value or NOTHING if none is set.
nothing setUserName(string user)
Sets the user name to use for the next connection.
nothing setURL(string url)
Sets the connection and login parameters based on the URL passed as an argument.
binary getAsBinary(string remote_path)
Gets a file from the FTP server and returns it as a binary.
hash getUsageInfo()
Returns performance statistics for the socket.
nothing setPassword(string pass)
Sets the password to use for the next connection.
hash< auto > hash(object obj)
Returns a hash of an object's members.
int getPort()
Retrieves the current connection port value for this object.
nothing mkdir(string remote_path)
Creates a directory on the FTP server; if any errors occur, an exception is thrown.
bool isSecure()
Returns True if the control connection is a secure TLS/SSL connection, False if not.
nothing setPort(int port)
Sets the control port value to use for the next connection (the FTP protocol default is 21)
string getAsString(string remote_path)
Gets a file from the FTP server and returns it as a string.
Queue objects provide a blocking, thread-safe message-passing object to Qore programs
Definition: QC_Queue.dox.h:17
destructor()
Disconnects any remote connection and destroys the object.
nothing setWarningQueue(int warning_ms, int warning_bs, Queue queue, auto arg, timeout min_ms=1s)
Sets a Queue object to receive socket warnings.
string msg
The response message string.
Definition: QC_FtpClient.dox.h:11
nothing setModeAuto()
Sets the object to automatically try to negotiate the data connections in EPSV, PASV,...
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...
main Qore-language namespace
Definition: Pseudo_QC_All.dox.h:3
This class defines an abstract interface for input streams.
Definition: QC_InputStream.dox.h:18
constructor()
Creates an empty FtpClient object.
nothing setInsecureData()
Make a non-encrypted data connection to the server on the next connect even if the control connection...
*string getHostName()
Returns the current hostname value or NOTHING if none is set.
nothing setDataEventQueue()
Clears any Queue object that may be set on the FtpClient object so that I/O events are no longer capt...
bool isDataSecure()
Returns True if the data connections are secure TLS/SSL connections, False if not.
nothing cwd(string path)
Changes the current working directory on the server.
nothing del(string remote_path)
Deletes a file from the FTP server; if any errors occur, an exception is thrown.
nothing rename(string from, string to)
Renames/moves a file or directory; if any errors occur, an exception is thrown.
hash< auto > getDataPeerInfo(bool host_lookup=True)
Returns information about the remote data socket as a hash.
nothing put(string local_path, *string remote_path)
Transfers a local file to the FTP server; if any errors occur, an exception is thrown.
int code
The integer response code.
Definition: QC_FtpClient.dox.h:9
nothing setInsecure()
Make a non-encrypted connection to the server on the next connect.
*string getUserName()
Returns the current username value or NOTHING if none is set.