|
Arduino TinyFTP
|
FTPClient Basic FTP access class which supports directory operations and the opening of files. Each open file or directory listing uses its own FTP session (command and data connection): idle sessions are reused. The files and iterators must not be used after the FTPClient has been destroyed. More...
#include <FTPClient.h>
Public Member Functions | |
| FTPClient (int port=FTP_COMMAND_PORT, bool useType=false) | |
| FTPClient (const FTPClient &)=delete | |
| FTPClient & | operator= (const FTPClient &)=delete |
| void | setUseTypeCommand (bool useType) |
| if set to true the BIN and ASCII command are executed as type I or A | |
| bool | begin (IPAddress remote_addr, const char *user="anonymous", const char *password=nullptr) |
| Defines the server details: the sessions are opened on demand. | |
| void | end () |
| FTPFile | open (const char *filename, FileMode mode=READ_MODE, bool=true) |
| bool | mkdir (const char *filepath) |
| bool | remove (const char *filepath) |
| Delete the file. | |
| bool | rmdir (const char *filepath) |
| Removes a directory. | |
| FTPFileIterator | ls (const char *path, FileMode mode=READ_MODE) |
| Lists all file names in the specified directory. | |
| bool | binary () |
| Switch to binary mode. | |
| bool | ascii () |
| Switch to ascii mode. | |
| bool | type (const char *str) |
| Binary or ascii with type command. | |
| void | setPort (int port) |
| bool | abort (CurrentOperation op) |
| int | count () |
| Count the connected sessions. | |
| int | count (CurrentOperation op) |
| Count the connected sessions with a specific current operation. | |
| FTPSession< ClientType > * | idleSession () override |
| Provides an idle, connected session: returns nullptr if none is available. | |
| FTPSession< ClientType > * | openDataSession () override |
Protected Attributes | |
| FTPSession< ClientType > * | sessions [FTP_MAX_SESSIONS] = {nullptr} |
| IPAddress | remote_addr |
| const char * | userid = nullptr |
| const char * | password = nullptr |
| int | port |
| bool | use_type_command = false |
FTPClient Basic FTP access class which supports directory operations and the opening of files. Each open file or directory listing uses its own FTP session (command and data connection): idle sessions are reused. The files and iterators must not be used after the FTPClient has been destroyed.
| ClientType | The type of client to use for command and data connections. It should be a class that implements the Client interface. |
|
inline |
Default constructor: Provide the client class as template argument e.g. FTPClient<WiFiClient> client;
|
inline |
Abort the indicated operation (e.g., READ_OP, WRITE_OP, LS_OP.) in all sessions. Returns false if no session was found or an abort failed.
|
inline |
Close the sessions by calling QUIT or BYE: open files and listings become invalid
|
inlineoverridevirtual |
Provides an idle, connected session: returns nullptr if none is available.
Implements tinyftp::FTPSessionProvider.
|
inline |
Create the requested directory hierarchy–if intermediate directories do not exist they will be created.
|
inline |
Open a file: the file is closed with close() or when the last copy of it is destroyed. The autoClose parameter is not used any more.
|
inlineoverridevirtual |
Provides a session with an open data connection which is reserved until the transfer has ended
Implements tinyftp::FTPSessionProvider.