Qore Programming Language Reference Manual  0.9.3
QC_FtpClient.dox.h
1 namespace Qore {
4 
82 class FtpClient {
83 
84 public:
86 
95  clearStats();
96 
97 public:
99 
108 nothing clearWarningQueue();
109 
110 public:
112 
129 nothing connect();
130 
131 public:
133 
138  constructor();
139 
140 public:
142 
154  constructor(string url);
155 
156 public:
158 
160  copy();
161 
162 public:
164 
177 nothing cwd(string path);
178 
179 public:
181 
196 nothing del(string remote_path);
197 
198 public:
200 
208  destructor();
209 
210 public:
212 
220 nothing disconnect();
221 
222 public:
224 
248 nothing get(string remote_path, *string local_path);
249 
250 public:
252 
272 nothing get(string remote_path, Qore::OutputStream os);
273 
274 public:
276 
296 binary getAsBinary(string remote_path);
297 
298 public:
300 
320 string getAsString(string remote_path);
321 
322 public:
324 
340 hash<auto> getControlPeerInfo(bool host_lookup = True);
341 
342 public:
344 
360 hash<auto> getControlSocketInfo(bool host_lookup = True);
361 
362 public:
364 
380 hash<auto> getDataPeerInfo(bool host_lookup = True);
381 
382 public:
384 
400 hash<auto> getDataSocketInfo(bool host_lookup = True);
401 
402 public:
404 
411 *string getHostName();
412 
413 public:
415 
425 string getMode();
426 
427 public:
429 
441 int getNetworkFamily();
442 
443 public:
445 
452 *string getPassword();
453 
454 public:
456 
463 int getPort();
464 
465 public:
467 
478 *string getSSLCipherName();
479 
480 public:
482 
493 *string getSSLCipherVersion();
494 
495 public:
497 
504 int getTimeout();
505 
506 public:
508 
515 string getURL();
516 
517 public:
519 
541 
542 public:
544 
551 *string getUserName();
552 
553 public:
555 
566 bool isDataSecure();
567 
568 public:
570 
580 bool isSecure();
581 
582 public:
584 
601 *string list();
602 
603 public:
605 
624 *string list(string path);
625 
626 public:
628 
643 nothing mkdir(string remote_path);
644 
645 public:
647 
664 *string nlst();
665 
666 public:
668 
687 *string nlst(string path);
688 
689 public:
691 
714 nothing put(string local_path, *string remote_path);
715 
716 public:
718 
738 nothing put(Qore::InputStream is, string remote_path);
739 
740 public:
742 
758 nothing putData(string data, string remote_path);
759 
760 public:
762 
778 nothing putData(binary data, string remote_path);
779 
780 public:
782 
797 string pwd();
798 
799 public:
801 
817 nothing rename(string from, string to);
818 
819 public:
821 
836 nothing rmdir(string remote_path);
837 
838 public:
840 
845 nothing setControlEventQueue();
846 
847 public:
849 
861 
862 public:
864 
869 nothing setDataEventQueue();
870 
871 public:
873 
885 
886 public:
888 
893 nothing setEventQueue();
894 
895 public:
897 
908 nothing setEventQueue(Qore::Thread::Queue queue);
909 
910 public:
912 
919 nothing setHostName(string host);
920 
921 public:
923 
930 nothing setInsecure();
931 
932 public:
934 
942 nothing setInsecureData();
943 
944 public:
946 
951 nothing setModeAuto();
952 
953 public:
955 
960 nothing setModeEPSV();
961 
962 public:
964 
969 nothing setModePASV();
970 
971 public:
973 
978 nothing setModePORT();
979 
980 public:
982 
993 nothing setNetworkFamily(int family);
994 
995 public:
997 
1004 nothing setPassword(string pass);
1005 
1006 public:
1008 
1017 nothing setPort(int port);
1018 
1019 public:
1021 
1030 nothing setSecure(bool secure = True);
1031 
1032 public:
1034 
1038  setTimeout(timeout timeout_ms);
1039 
1040 public:
1042 
1054 nothing setURL(string url);
1055 
1056 public:
1058 
1065 nothing setUserName(string user);
1066 
1067 public:
1069 
1101 nothing setWarningQueue(int warning_ms, int warning_bs, Queue queue, auto arg, timeout min_ms = 1s);
1102 
1103 public:
1105 
1116 *string verifyPeerCertificate();
1117 };
1118 };
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.
setTimeout(timeout timeout_ms)
sets the socket I/O timeout value in milliseconds
const True
logical True
Definition: qc_qore.dox.h:94
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:82
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
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:15
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.
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:2
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.
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.