toolbox.ftp
Class FTPPutClientCommonsImpl

Package class diagram package FTPPutClientCommonsImpl
java.lang.Object
  extended by toolbox.ftp.FTPPutClientCommonsImpl
All Implemented Interfaces:
FTPPutClient

public class FTPPutClientCommonsImpl
extends java.lang.Object
implements FTPPutClient

Implementation of the FTPPutClient interface that employs the Apache Commons Net FTP package.


Constructor Summary
FTPPutClientCommonsImpl()
          Default constructor.
 
Method Summary
 void destroy()
          Destroy this client.
 java.lang.String getName()
          Return the name of this client.
 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 putLocalFile(java.lang.String localFileName, java.lang.String remoteFileName)
          Store a single file from the configured local directory and place the file in the configured remote directory.
 void putLocalFiles()
          Store all the files from the configured local directory and place them in the configured remote directory.
 void putLocalFiles(int fileCount)
          Store n number of files from the configured local directory and place them in the configured remote directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FTPPutClientCommonsImpl

public FTPPutClientCommonsImpl()
Default constructor.

Method Detail

init

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

Specified by:
init in interface FTPPutClient
Parameters:
name - String containing the name of this client.
props - Map instance containing the client configuration properties.
manager - FTPManager instance that created this client.

getName

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

Specified by:
getName in interface FTPPutClient
Returns:
String containing the name of this client.

putLocalFile

public void putLocalFile(java.lang.String localFileName,
                         java.lang.String remoteFileName)
                  throws FTPException
Store a single file from the configured local directory and place the file in the configured remote directory.

Specified by:
putLocalFile in interface FTPPutClient
Parameters:
localFileName - String containing the name of the local file.
remoteFileName - String containing the name of the remote file.
Throws:
FTPException - if the file cannot be stored.

putLocalFiles

public void putLocalFiles()
                   throws FTPException
Store all the files from the configured local directory and place them in the configured remote directory.

Specified by:
putLocalFiles in interface FTPPutClient
Throws:
FTPException - if the files cannot be retrieved.

putLocalFiles

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

Specified by:
putLocalFiles in interface FTPPutClient
Parameters:
fileCount - int indicating the maximum number of files to store. Pass -1 to store all files.
Throws:
FTPException - if the files cannot be retrieved.

destroy

public void destroy()
Destroy this client.

Specified by:
destroy in interface FTPPutClient