net.sf.hermesftp.server.impl
Class FtpServerOptionsImpl

java.lang.Object
  extended by net.sf.hermesftp.server.impl.FtpServerOptionsImpl
All Implemented Interfaces:
FtpConstants, FtpServerOptions

public class FtpServerOptionsImpl
extends java.lang.Object
implements FtpServerOptions, FtpConstants

The FTP server options used throughout the application.

Author:
Lars Behnke

Field Summary
 
Fields inherited from interface net.sf.hermesftp.common.FtpConstants
ATTR_CLIENT_NAME, ATTR_DATA_PROT, ATTR_FILE_OFFSET, ATTR_FORCE_UTF8, ATTR_GROUP_DATA, ATTR_LOGIN_TIME, ATTR_RENAME_FILE, ATTR_RESTART_MARKERS, ATTR_SSL, ATTR_USER_DATA, BYTE_LENGTH, BYTE_MASK, DEFAULT_BEAN_RES, DEFAULT_KEYSTORE, DEFAULT_KEYSTORE_PASS, DT_ASCII, DT_BINARY, DT_EBCDIC, HERMES_HOME, MILLI, MODE_BLOCK, MODE_COMPRESS, MODE_STREAM, MODE_ZIP, MSG_GOODBYE, MSG150, MSG200, MSG200_NOTED, MSG200_PBSZ, MSG200_SIZE, MSG200_TYPE, MSG202, MSG211_FEAT_ENTRY, MSG211_FEAT_FOOTER, MSG211_FEAT_HEADER, MSG211_STAT, MSG213_SIZE, MSG213_TIME, MSG214, MSG220, MSG220_WEL, MSG226, MSG227, MSG229, MSG230, MSG234, MSG250, MSG257, MSG331, MSG350, MSG350_REST, MSG421, MSG425, MSG426, MSG431, MSG450, MSG451, MSG500, MSG500_CMD, MSG501, MSG501_PATH, MSG501_SIZE, MSG503, MSG503_USR, MSG504, MSG522, MSG530, MSG530_AUTH, MSG534, MSG536, MSG550, MSG550_COMM, MSG550_EXISTS, MSG550_MSG, MSG550_NOTEMPTY, MSG550_PERM, MSG553, OPT_ALLOWED_PASSIVE_PORTS, OPT_BUFFER_SIZE, OPT_CHARSET_ASCII, OPT_CHARSET_EBCDIC, OPT_EMULATE_UNIX, OPT_FTP_PORT, OPT_IPV4_BLACK_LIST, OPT_IPV6_BLACK_LIST, OPT_MAX_CONNECTIONS, OPT_MAX_DOWNLOAD_RATE, OPT_MAX_IDLE_SECONDS, OPT_MAX_UPLOAD_RATE, OPT_MSG_GOODBYE, OPT_MSG_WELCOME, OPT_REMOTE_DIR, OPT_SSL_ALLOW_EXPLICIT, OPT_SSL_ALLOW_IMPLICIT, OPT_SSL_CIPHER_SUITES, OPT_SSL_FORCE, OPT_SSL_KEYSTORE_FILE, OPT_SSL_KEYSTORE_PASS, OPT_SSL_PORT_IMPLICIT, PRIV_NONE, PRIV_READ, PRIV_READ_WRITE, PRIV_WRITE, PWD, SEPARATOR, SERVER_STATUS_HALTED, SERVER_STATUS_INIT, SERVER_STATUS_READY, SERVER_STATUS_UNDEF, SPACE, STAT_BYTES_DOWNLOADED, STAT_BYTES_UPLOADED, STAT_DOWNLOAD_RATE, STAT_FILES_DOWNLOADED, STAT_FILES_UPLOADED, STAT_UPLOAD_RATE, STRUCT_FILE, STRUCT_RECORD, TYPE_NAMES, WILDCARD
 
Constructor Summary
FtpServerOptionsImpl()
           
 
Method Summary
 java.lang.Integer[] getAllowedPorts()
          Returns a set of all allowed passive ports.
 java.lang.String getAppBuildInfo()
          Returns the application build info as defined in the POM file.
 java.lang.String getAppTitle()
          Returns the application title as defined in the POM file.
 java.lang.String getAppVersion()
          Returns the application version as defined in the POM file.
 boolean getBoolean(java.lang.String optionName, boolean defaultValue)
          Returns a an option as boolean value.
 int getBufferSize()
          Read the buffer size for downloading or uploading files.
 int getFtpPort()
          Returns the FTP port.
 int getImplicitSslPort()
          Returns the implicit SSL port.
 int getInt(java.lang.String optionName, int defaultValue)
          Returns a an option as integer value.
 int[] getIntArray(java.lang.String optionName, int[] defaultValues)
          Returns an array of integer options.
 java.util.Properties getProperties()
          Getter method for the java bean properties.
 java.lang.String getProperty(java.lang.String key)
          Convenience method for accessing the options.
 java.lang.String getRootDir()
          Getter method for the server side remote directory.
 javax.net.ssl.SSLContext getSslContext()
          Returns the SSL context to be used for creating SSL sockets.
 java.lang.String getString(java.lang.String optionName, java.lang.String defaultValue)
          Returns a an option as string value.
 java.lang.String[] getStringArray(java.lang.String optionName, java.lang.String[] defaultValues)
          Returns an array of options.
 java.util.Properties getSystemProperties()
          Getter method for the java bean systemProperties.
 void setProperties(java.util.Properties properties)
          Setter method for the java bean properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FtpServerOptionsImpl

public FtpServerOptionsImpl()
Method Detail

getProperties

public java.util.Properties getProperties()
Getter method for the java bean properties.

Specified by:
getProperties in interface FtpServerOptions
Returns:
Returns the value of the java bean properties.

setProperties

public void setProperties(java.util.Properties properties)
Setter method for the java bean properties.

Specified by:
setProperties in interface FtpServerOptions
Parameters:
properties - The value of properties to set.

getProperty

public java.lang.String getProperty(java.lang.String key)
Convenience method for accessing the options.

Specified by:
getProperty in interface FtpServerOptions
Parameters:
key - The option key.
Returns:
The option value as string.

getBufferSize

public int getBufferSize()
Read the buffer size for downloading or uploading files. The default buffer size is 1024 bytes.

Specified by:
getBufferSize in interface FtpServerOptions
Returns:
The buffer size;

getRootDir

public java.lang.String getRootDir()
Getter method for the server side remote directory.

Specified by:
getRootDir in interface FtpServerOptions
Returns:
The directory

getFtpPort

public int getFtpPort()
Returns the FTP port.

Specified by:
getFtpPort in interface FtpServerOptions
Returns:
The port.

getImplicitSslPort

public int getImplicitSslPort()
Returns the implicit SSL port.

Specified by:
getImplicitSslPort in interface FtpServerOptions
Returns:
The port.

getBoolean

public boolean getBoolean(java.lang.String optionName,
                          boolean defaultValue)
Returns a an option as boolean value.

Specified by:
getBoolean in interface FtpServerOptions
Parameters:
optionName - The name of the option.
defaultValue - The default value.
Returns:
The boolean value.

getInt

public int getInt(java.lang.String optionName,
                  int defaultValue)
Returns a an option as integer value.

Specified by:
getInt in interface FtpServerOptions
Parameters:
optionName - The name of the option.
defaultValue - The default value.
Returns:
The integer.

getString

public java.lang.String getString(java.lang.String optionName,
                                  java.lang.String defaultValue)
Returns a an option as string value.

Specified by:
getString in interface FtpServerOptions
Parameters:
optionName - The name of the option.
defaultValue - The default value.
Returns:
The string.

getStringArray

public java.lang.String[] getStringArray(java.lang.String optionName,
                                         java.lang.String[] defaultValues)
Returns an array of options. The corresponding property value has to be a comma separated list.

Specified by:
getStringArray in interface FtpServerOptions
Parameters:
optionName - The name of the option.
defaultValues - The default values.
Returns:
The array.

getIntArray

public int[] getIntArray(java.lang.String optionName,
                         int[] defaultValues)
Returns an array of integer options. The corresponding property value has to be a comma separated list.

Specified by:
getIntArray in interface FtpServerOptions
Parameters:
optionName - The name of the option.
defaultValues - The default values.
Returns:
The array.

getAllowedPorts

public java.lang.Integer[] getAllowedPorts()
Returns a set of all allowed passive ports.

Specified by:
getAllowedPorts in interface FtpServerOptions
Returns:
The set.

getSslContext

public javax.net.ssl.SSLContext getSslContext()
                                       throws FtpConfigException
Returns the SSL context to be used for creating SSL sockets.

Specified by:
getSslContext in interface FtpServerOptions
Returns:
The SSL context.
Throws:
FtpConfigException - Error initializing SSL context or keystore.

getAppTitle

public java.lang.String getAppTitle()
Returns the application title as defined in the POM file.

Specified by:
getAppTitle in interface FtpServerOptions
Returns:
The application title.

getAppVersion

public java.lang.String getAppVersion()
Returns the application version as defined in the POM file.

Specified by:
getAppVersion in interface FtpServerOptions
Returns:
The application version.

getAppBuildInfo

public java.lang.String getAppBuildInfo()
Returns the application build info as defined in the POM file.

Specified by:
getAppBuildInfo in interface FtpServerOptions
Returns:
The application build info.

getSystemProperties

public java.util.Properties getSystemProperties()
Getter method for the java bean systemProperties.

Specified by:
getSystemProperties in interface FtpServerOptions
Returns:
Returns the value of the java bean systemProperties.


Copyright © 2005-2007 Lars Behnke. All Rights Reserved.