|
Qore Programming Language
0.9.16
|
34 #ifndef _QORE_QOREFTPCLIENT_H
36 #define _QORE_QOREFTPCLIENT_H
38 #include <qore/InputStream.h>
39 #include <qore/OutputStream.h>
41 #define DEFAULT_FTP_CONTROL_PORT 21
42 #define DEFAULT_FTP_DATA_PORT 20
44 #define DEFAULT_USERNAME "anonymous"
74 hashdecl qore_ftp_private *
priv;
133 DLLEXPORT
int put(
const char *localpath,
const char *remotename,
ExceptionSink *xsink);
154 DLLEXPORT
int get(
const char *remotepath,
const char *localname,
ExceptionSink *xsink);
331 DLLEXPORT
const char*
getMode()
const;
336 DLLEXPORT
void clearStats();
457 #endif // _QORE_OBJECTS_FTPCLIENT_H
Interface for private data of output streams.
Definition: OutputStream.h:44
DLLEXPORT bool isDataSecure() const
returns the secure data connection parameter flag
DLLEXPORT QoreHashNode * getControlSocketInfo(ExceptionSink *xsink, bool host_lookup) const
returns information for the current control socket; the socket must be open
DLLEXPORT void setModePORT()
sets the connection mode for the next connection to "PORT"
DLLEXPORT QoreStringNode * getURL() const
returns a URL string representing the current connection parameters, caller owns the reference count ...
DLLEXPORT void setHostName(const char *h)
sets the host name connection parameter
DLLLOCAL int getTimeout() const
returns the socket I/O timeout value as an integer in milliseconds
DLLEXPORT bool isSecure() const
returns the secure connection parameter flag
const DLLEXPORT char * getSSLCipherName() const
returns the name of the SSL Cipher for the currently-connected control connection,...
The main value class in Qore, designed to be passed by value.
Definition: QoreValue.h:262
DLLEXPORT int get(const char *remotepath, const char *localname, ExceptionSink *xsink)
gets a file from the remote server and saves it on the local filesystem
DLLEXPORT void setPort(int p)
sets the port connection parameter
This is the hash or associative list container type in Qore, dynamically allocated only,...
Definition: QoreHashNode.h:50
DLLEXPORT QoreHashNode * getControlPeerInfo(ExceptionSink *xsink, bool host_lookup) const
returns peer information for a connected control socket
DLLLOCAL void setTimeout(int timeout_ms)
sets the socket I/O timeout value in milliseconds
DLLEXPORT void setModePASV()
sets the connection mode for the next connection to "PASV" (passive mode)
size_t qore_size_t
used for sizes (same range as a pointer)
Definition: common.h:73
DLLEXPORT void setUserName(const char *u)
sets the user name connection parameter
DLLEXPORT int setInsecureData()
sets the secure data connection parameter flag
DLLEXPORT void setURL(const QoreString *url, ExceptionSink *xsink)
sets the connection parameters from a URL
DLLEXPORT int rmdir(const char *remotepath, ExceptionSink *xsink)
removes a directory on the remote server
QoreHashNode * sendControlMessage(const char *cmd, const char *arg, ExceptionSink *xsink)
Sends a message on the control port and returns a FtpResponseInfo hash or nullptr (if an exception is...
long long int64
64bit integer type, cannot use int64_t here since it breaks the API on some 64-bit systems due to equ...
Definition: common.h:260
DLLEXPORT void setNetworkFamily(int family)
sets the network family to use with new connections
DLLEXPORT int put(const char *localpath, const char *remotename, ExceptionSink *xsink)
sends a file from the local filesystem to the remote server
DLLLOCAL void setEventQueue(ExceptionSink *xsink, Queue *q, QoreValue arg, bool with_data)
sets the same event queue for data and control sockets
DLLEXPORT int cwd(const char *dir, ExceptionSink *xsink)
changes the working directory on the remote host
Qore's string type supported by the QoreEncoding class.
Definition: QoreString.h:81
DLLEXPORT QoreStringNode * list(const char *path, bool long_list, ExceptionSink *xsink)
returns a string listing the directory contents on the remote host (caller owns the reference count r...
DLLEXPORT void setModeEPSV()
sets the connection mode for the next connection to "EPSV" (extended passive mode)
DLLEXPORT QoreHashNode * getDataPeerInfo(ExceptionSink *xsink, bool host_lookup) const
returns peer information for a connected data socket
DLLLOCAL void setControlEventQueue(ExceptionSink *xsink, Queue *q, QoreValue arg, bool with_data)
sets the event queue for the control socket
DLLEXPORT int mkdir(const char *remotepath, ExceptionSink *xsink)
creates a directory on the remote server
const DLLEXPORT char * getMode() const
returns a string for the connection mode: "port", "pasv", "epsv", or "auto" if not connected and auto...
DLLEXPORT ~QoreFtpClient()
disconnects from the host if necessary and frees all memory associated with the object
DLLEXPORT int setSecure()
sets the secure connection parameter flag (to use the FTPS protocol)
DLLEXPORT QoreStringNode * getAsString(const char *remotepath, ExceptionSink *xsink)
gets a file from the remote server and returns it as a string
DLLEXPORT void setPassword(const char *p)
sets the password connection parameter
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition: ExceptionSink.h:48
DLLEXPORT int setInsecure()
unsets the secure connection parameter flag (to use the FTP protocol)
hashdecl qore_ftp_private * priv
private implementation of the object
Definition: QoreFtpClient.h:74
const DLLEXPORT char * getPassword() const
returns the password connection parameter
DLLEXPORT int disconnect()
disconnects from the remote host if connected
DLLEXPORT int getNetworkFamily() const
returns the network family to use with new connections
const DLLEXPORT char * getSSLCipherVersion() const
returns the version string of the SSL Cipher for the currently-connected control connection,...
DLLEXPORT QoreHashNode * getDataSocketInfo(ExceptionSink *xsink, bool host_lookup) const
returns information for the current control socket; the socket must be open
DLLEXPORT BinaryNode * getAsBinary(const char *remotepath, ExceptionSink *xsink)
gets a file from the remote server and returns it as a binary node
DLLEXPORT long verifyPeerCertificate() const
returns the peer certificate verification code
provides thread-safe access to FTP servers through Qore data structures
Definition: QoreFtpClient.h:71
DLLEXPORT QoreStringNode * pwd(ExceptionSink *xsink)
returns the working directory on the remote host (caller owns the reference count returned)
DLLEXPORT int getPort() const
returns the port number connection parameter
DLLEXPORT QoreFtpClient()
creates the object with no connection parameters
DLLEXPORT void setModeAuto()
sets the connection mode for the next connection to "auto"
DLLLOCAL void setDataEventQueue(ExceptionSink *xsink, Queue *q, QoreValue arg, bool with_data)
sets the event queue for the data socket
DLLEXPORT int connect(ExceptionSink *xsink)
connects to the remote host and logs in
holds arbitrary binary data
Definition: BinaryNode.h:41
const DLLEXPORT char * getHostName() const
returns the hostname connection parameter
DLLEXPORT int del(const char *file, ExceptionSink *xsink)
deletes the given file on the remote server
Qore's string value type, reference counted, dynamically-allocated only.
Definition: QoreStringNode.h:50
DLLLOCAL QoreFtpClient & operator=(const QoreFtpClient &)
this function is not implemented; it is here as a private function in order to prohibit it from being...
const DLLEXPORT char * getUserName() const
returns the user name connection parameter
DLLEXPORT int putData(const void *data, qore_size_t len, const char *remotename, ExceptionSink *xsink)
sends a file data io the remote server
DLLEXPORT int rename(const char *from, const char *to, ExceptionSink *xsink)
renames/moves a file on the remote server