Logo Search packages:      
Sourcecode: poco version File versions  Download package

Poco::Net::FTPClientSession Class Reference

#include <FTPClientSession.h>

List of all members.

Detailed Description

This class implements an File Transfer Protocol (FTP, RFC 959) client.

Most of the features of the FTP protocol, as specified in RFC 959, are supported. Not supported are EBCDIC and LOCAL data types and format control and structured files.

Also supported are the EPRT and EPSV commands from RFC 1738 (FTP Extensions for IPv6 and NAT). The client will first attempt to use the EPRT and EPSV commands. If the server does not supports these commands, the client will fall back to PORT and PASV.

Definition at line 57 of file FTPClientSession.h.

Public Types

enum  { FTP_PORT = 21 }
enum  FileType { TYPE_TEXT, TYPE_BINARY }

Public Member Functions

void abort ()
std::istream & beginDownload (const std::string &path)
std::istream & beginList (const std::string &path="", bool extended=false)
std::ostream & beginUpload (const std::string &path)
void cdup ()
void close ()
void createDirectory (const std::string &path)
void endDownload ()
void endList ()
void endUpload ()
 FTPClientSession (const std::string &host, Poco::UInt16 port=FTP_PORT)
 FTPClientSession (const StreamSocket &socket)
FileType getFileType () const
bool getPassive () const
 Enables (default) or disables FTP passive mode for this session.
Poco::Timespan getTimeout () const
 Sets the timeout for socket operations.
std::string getWorkingDirectory ()
void login (const std::string &username, const std::string &password)
 Returns true iff passive mode is enabled for this connection.
void remove (const std::string &path)
void removeDirectory (const std::string &path)
void rename (const std::string &oldName, const std::string &newName)
int sendCommand (const std::string &command, const std::string &arg, std::string &response)
int sendCommand (const std::string &command, std::string &response)
void setFileType (FileType type)
void setPassive (bool flag)
 Returns the timeout for socket operations.
void setTimeout (const Poco::Timespan &timeout)
 Destroys the FTPClientSession.
void setWorkingDirectory (const std::string &path)
 Returns the file type for transferring files.
std::string systemType ()
virtual ~FTPClientSession ()

Protected Types

enum  { DEFAULT_TIMEOUT = 30000000 }
enum  StatusClass {

Protected Member Functions

StreamSocket activeDataConnection (const std::string &command, const std::string &arg)
void endTransfer ()
StreamSocket establishDataConnection (const std::string &command, const std::string &arg)
std::string extractPath (const std::string &response)
void parseAddress (const std::string &str, SocketAddress &addr)
void parseExtAddress (const std::string &str, SocketAddress &addr)
StreamSocket passiveDataConnection (const std::string &command, const std::string &arg)
bool sendEPRT (const SocketAddress &addr)
bool sendEPSV (SocketAddress &addr)
SocketAddress sendPassiveCommand ()
void sendPASV (SocketAddress &addr)
void sendPORT (const SocketAddress &addr)
void sendPortCommand (const SocketAddress &addr)

Static Protected Member Functions

static bool isPermanentNegative (int status)
static bool isPositiveCompletion (int status)
static bool isPositiveIntermediate (int status)
static bool isPositivePreliminary (int status)
static bool isTransientNegative (int status)

Private Member Functions

 FTPClientSession (const FTPClientSession &)
FTPClientSessionoperator= (const FTPClientSession &)

Private Attributes

DialogSocket _controlSocket
FileType _fileType
bool _isOpen
bool _passiveMode
bool _supports1738
Poco::Timespan _timeout

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index