class PFTPClient

File Transfer Protocol client channel class

Inheritance:


Public Methods

[more] PFTPClient ()
Declare an FTP client socket
[more] ~PFTPClient ()
Delete and close the socket
[more] Overrides from class PSocket.
[more] New functions for class

Protected Fields

[more]WORD remotePort
Port number on remote system

Protected Methods

[more]virtual BOOL OnOpen ()
Call back to verify open succeeded in an PInternetProtocol class


Inherited from PFTP:

Public Methods

oBOOL SendPORT( const PIPSocket::Address & addr, WORD port )

Public Members

oenum Commands
oenum RepresentationType
oenum DataChannelType
oenum NameTypes


Inherited from PInternetProtocol:

Public Methods

ovirtual BOOL Read( void* buf, PINDEX len )
ovirtual BOOL Write( const void* buf, PINDEX len )
ovoid SetReadLineTimeout( const PTimeInterval & t )
ovirtual BOOL Connect( const PString & address, WORD port = 0 )
ovirtual BOOL Accept( PSocket & listener )
oconst PString& GetDefaultService() const
oPIPSocket* GetSocket() const
ovirtual BOOL WriteLine( const PString & line )
ovirtual BOOL ReadLine( PString & line, BOOL allowContinuation = FALSE )
ovirtual void UnRead( int ch )
ovirtual BOOL WriteCommand( PINDEX cmdNumber )
ovirtual BOOL ReadCommand( PINDEX & num, PString & args )
ovirtual BOOL WriteResponse( unsigned numericCode, const PString & info )
ovirtual BOOL ReadResponse()
ovirtual int ExecuteCommand( PINDEX cmdNumber )
oint GetLastResponseCode() const
oPString GetLastResponseInfo() const

Protected Methods

ovirtual PINDEX ParseResponse( const PString & line )


Inherited from PIndirectChannel:

Public Methods

Construction

Overrides from class PObject

Overrides from class PChannel

Channel establish functions

Protected Fields

oPChannel* readChannel
oBOOL readAutoDelete
oPChannel* writeChannel
oBOOL writeAutoDelete
oPReadWriteMutex channelPointerMutex


Inherited from PChannel:

Public Methods

Information functions

Reading functions

Writing functions

Miscellaneous functions

ostatic BOOL ConvertOSError( int libcReturnValue, Errors & lastError, int & osError )

Public Members

Error functions

Protected Fields

oint os_handle
oErrors lastErrorCode[NumErrorGroups+1]
oint lastErrorNumber[NumErrorGroups+1]
oPINDEX lastReadCount
oPINDEX lastWriteCount
oPTimeInterval readTimeout
oPTimeInterval writeTimeout

Protected Methods

ovirtual BOOL ConvertOSError( int libcReturnValue, ErrorGroup group = LastGeneralError )
oBOOL SetErrorValues( Errors errorCode, int osError, ErrorGroup group = LastGeneralError )
oint ReadCharWithTimeout( PTimeInterval & timeout )


Inherited from PObject:

Public Methods

Run Time Type functions

I/O functions

Public Members

Comparison functions


Documentation

File Transfer Protocol client channel class
o PFTPClient()
Declare an FTP client socket

o ~PFTPClient()
Delete and close the socket

o Overrides from class PSocket.

ovirtual BOOL Close()
Close the socket, and if connected as a client, QUITs from server.

Returns:
TRUE if the channel was closed and the QUIT accepted by the server.

o New functions for class

oBOOL LogIn( const PString & username, const PString & password )
Log in to the remote host for FTP.

Parameters:
username - User name for FTP log in.
password - Password for the specified user name.
Returns:
TRUE if the log in was successfull.

oPString GetSystemType()
Get the type of the remote FTP server system, eg Unix, WindowsNT etc.

Returns:
String for the type of system.

oBOOL SetType( RepresentationType type )
Set the transfer type.

Parameters:
- type RepresentationTypeof file to transfer
Returns:
TRUE if transfer type set.

oBOOL ChangeDirectory( const PString & dirPath )
Change the current directory on the remote FTP host.

Parameters:
dirPath - New directory
Returns:
TRUE if the log in was successfull.

oPString GetCurrentDirectory()
Get the current working directory on the remote FTP host.

Returns:
String for the directory path, or empty string if an error occurred.

oPStringArray GetDirectoryNames( NameTypes type = ShortNames, DataChannelType channel = Passive )
Get a list of files from the current working directory on the remote FTP host.

Parameters:
- type Detail level on a directory entry.
channel - Data channel type.
Returns:
String array for the files in the directory.

oPStringArray GetDirectoryNames( const PString & path, NameTypes type = ShortNames, DataChannelType channel = Passive )
Get a list of files from the current working directory on the remote FTP host.

Parameters:
- path Name to get details for.
- type Detail level on a directory entry.
channel - Data channel type.
Returns:
String array for the files in the directory.

oPString GetFileStatus( const PString & path, DataChannelType channel = Passive )
Get status information for the file path specified.

Parameters:
- path Path to get status for.
channel - Data channel type.
Returns:
String giving file status.

oPTCPSocket* GetFile( const PString & filename, DataChannelType channel = NormalPort )
Begin retreiving a file from the remote FTP server. The second parameter indicates that the transfer is on a normal or passive data channel. In short, a normal transfer the server connects to the client and in passive mode the client connects to the server.

Parameters:
filename - Name of file to get
channel - Data channel type.
Returns:
Socket to read data from, or NULL if an error occurred.

oPTCPSocket* PutFile( const PString & filename, DataChannelType channel = NormalPort )
Begin storing a file to the remote FTP server. The second parameter indicates that the transfer is on a normal or passive data channel. In short, a normal transfer the server connects to the client and in passive mode the client connects to the server.

Parameters:
filename - Name of file to get
channel - Data channel type.
Returns:
Socket to write data to, or NULL if an error occurred.

ovirtual BOOL OnOpen()
Call back to verify open succeeded in an PInternetProtocol class

oWORD remotePort
Port number on remote system


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.