toolbox.ftp
Interface FTPGetClient

Package class diagram package FTPGetClient
All Known Implementing Classes:
FTPGetClientCommonsImpl

public interface FTPGetClient

Interface that defines a generic FTP client to retrieve files from a remote server.


Method Summary
 void destroy()
          Destroy this client.
 java.lang.String getName()
          Return the name of this client.
 void getRemoteFile(java.lang.String fileName)
          Retrieve a single file from the configured remote directory and place the file in the configured local directory.
 void getRemoteFiles()
          Retrieve all the files from the configured remote directory and place them in the configured local directory.
 void getRemoteFiles(int fileCount)
          Retrieve n number of files from the configured remote directory and place them in the configured local directory.
 void init(java.lang.String name, java.util.Map props, FTPManager manager)
          Initialise this client with a reference to the manager that created it.
 void setFTPGetListener(FTPGetListener listener)
          Set the listener that must be used by this client to process downloaded files.
 

Method Detail

init

void init(java.lang.String name,
          java.util.Map props,
          FTPManager manager)
Initialise this client with a reference to the manager that created it.

Parameters:
name - Sting containing the name of this client.
props - Map instance containing the client configuration properties.
manager - FTPManager instance that created this client.

getName

java.lang.String getName()
Return the name of this client.

Returns:
String containing the name of this client.

setFTPGetListener

void setFTPGetListener(FTPGetListener listener)
Set the listener that must be used by this client to process downloaded files.

Parameters:
listener - FTPGetListener implementation that must be used to process downloaded files.

getRemoteFile

void getRemoteFile(java.lang.String fileName)
                   throws FTPException
Retrieve a single file from the configured remote directory and place the file in the configured local directory.

A FTPGetEvent is delivered to the configured listener.

Parameters:
fileName - String containing the name of the remote file.
Throws:
FTPException - if the file cannot be retrieved.

getRemoteFiles

void getRemoteFiles()
                    throws FTPException
Retrieve all the files from the configured remote directory and place them in the configured local directory.

The FTPGetEvent(s) is delivered to the configured listener depending on the configured event mode.

Throws:
FTPException - if the files cannot be retrieved.

getRemoteFiles

void getRemoteFiles(int fileCount)
                    throws FTPException
Retrieve n number of files from the configured remote directory and place them in the configured local directory.

The FTPGetEvent(s) is delivered to the configured listener depending on the configured event mode.

Parameters:
fileCount - int indicating the maximum number of files that may be retrieved. Pass -1 to retrieve all files.
Throws:
FTPException - if the files cannot be retrieved.

destroy

void destroy()
Destroy this client.