toolbox.allegato
Class FTPConfig

Package class diagram package FTPConfig
java.lang.Object
  extended by toolbox.allegato.FTPConfig

public class FTPConfig
extends java.lang.Object

Encapsulates the configuration of a FTPClient connection. The class provides access to all FTP parameters specified in a XML element or set using the set methods.

The class also provides a method to establish the connection.


Constructor Summary
FTPConfig()
          Default constructor
FTPConfig(java.lang.String name, XMLProperties xmlProps)
          Initialises this config object with the given XML configuration
 
Method Summary
 org.apache.commons.net.ftp.FTPClient createFTPClient()
          Creates a FTPClient using the configuration properties of this configuration object and returns the reference.
 java.lang.String getConnectionMode()
          Returns the connection mode string for this config object.
 java.lang.String getPassword()
          Returns the password for this config object.
 java.lang.String getPort()
          Returns the port string for this config object.
 java.lang.String getServer()
          Returns the server string for this config object.
 java.lang.String getTransferMode()
          Returns the transfer mode string for this config object.
 java.lang.String getUserName()
          Returns the user name for this config object.
 void setConnectionMode(java.lang.String connection)
          Set the connection mode string for this config object.
 void setPassword(java.lang.String password)
          Set the password for this config object.
 void setPort(java.lang.String port)
          Set the port string for this config object.
 void setServer(java.lang.String server)
          Set the the server string for this config object.
 void setTransferMode(java.lang.String transfer)
          Set the transfer mode string for this config object.
 void setUserName(java.lang.String userName)
          Set the user name for this config object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FTPConfig

public FTPConfig()
Default constructor


FTPConfig

public FTPConfig(java.lang.String name,
                 XMLProperties xmlProps)
          throws ConfException
Initialises this config object with the given XML configuration

Parameters:
name - The name of the FTP configuration
xmlProps - XML configuration properties containing a valid FTPConfig element.
Throws:
ConfException - if this object cannot be initialised.
Method Detail

setServer

public void setServer(java.lang.String server)
Set the the server string for this config object.

Parameters:
server - Server name.

getServer

public java.lang.String getServer()
Returns the server string for this config object.

Returns:
String containing the server for this object.

setPort

public void setPort(java.lang.String port)
Set the port string for this config object.

Parameters:
port - Port number.

getPort

public java.lang.String getPort()
Returns the port string for this config object.

Returns:
String containing the port for this object.

setTransferMode

public void setTransferMode(java.lang.String transfer)
Set the transfer mode string for this config object.

Parameters:
transfer - Transfer mode.

getTransferMode

public java.lang.String getTransferMode()
Returns the transfer mode string for this config object.

Returns:
String containing the transfer mode for this object.

setConnectionMode

public void setConnectionMode(java.lang.String connection)
Set the connection mode string for this config object.

Parameters:
connection - Connection mode.

getConnectionMode

public java.lang.String getConnectionMode()
Returns the connection mode string for this config object.

Returns:
String containing the connection mode for this object.

setUserName

public void setUserName(java.lang.String userName)
Set the user name for this config object.

Parameters:
userName - User name used to establish database connection.

getUserName

public java.lang.String getUserName()
Returns the user name for this config object.

Returns:
String containing user name used by this object to establish a database connection.

setPassword

public void setPassword(java.lang.String password)
Set the password for this config object.

Parameters:
password - Password used by this object to establish a database connection.

getPassword

public java.lang.String getPassword()
Returns the password for this config object.

Returns:
String containing the password used by this object to establish database connection.

createFTPClient

public org.apache.commons.net.ftp.FTPClient createFTPClient()
                                                     throws java.io.IOException
Creates a FTPClient using the configuration properties of this configuration object and returns the reference.

Returns:
FTPClient instance.
Throws:
java.io.IOException - if a connection cannot be established.