org.apache.ftpserver.config
Class PropertiesConfiguration

java.lang.Object
  extended by org.apache.ftpserver.config.PropertiesConfiguration
All Implemented Interfaces:
Configuration

public class PropertiesConfiguration
extends java.lang.Object
implements Configuration

Properties based configuration.


Field Summary
protected  java.lang.String prefix
           
protected  java.util.Properties prop
           
 
Constructor Summary
protected PropertiesConfiguration()
          Private constructor - used internally to get configuration subset.
  PropertiesConfiguration(java.io.InputStream in)
          Constructor - set the properties input stream.
  PropertiesConfiguration(java.util.Properties prop)
          Constructor - set the properties.
 
Method Summary
 boolean getBoolean(java.lang.String param)
          Get boolean - if not found throws FtpException.
 boolean getBoolean(java.lang.String param, boolean defaultVal)
          Get boolean - if not found returns the default value.
 double getDouble(java.lang.String param)
          Get double - if not found throws FtpException.
 double getDouble(java.lang.String param, double defaultVal)
          Get double - if not found returns the default value.
 int getInt(java.lang.String param)
          Get integer - if not found throws FtpException.
 int getInt(java.lang.String param, int defaultVal)
          Get int - if not found returns the default value.
 java.util.Iterator<java.lang.String> getKeys()
          Get configuration keys.
 long getLong(java.lang.String param)
          Get long - if not found throws FtpException.
 long getLong(java.lang.String param, long defaultVal)
          Get long - if not found returns the default value.
 java.lang.String getString(java.lang.String param)
          Get string - if not found throws FtpException.
 java.lang.String getString(java.lang.String param, java.lang.String defaultVal)
          Get string - if not found returns the default value.
 boolean isEmpty()
          Is empty?
 Configuration subset(java.lang.String param)
          Get sub configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

prop

protected java.util.Properties prop

prefix

protected java.lang.String prefix
Constructor Detail

PropertiesConfiguration

protected PropertiesConfiguration()
Private constructor - used internally to get configuration subset.


PropertiesConfiguration

public PropertiesConfiguration(java.io.InputStream in)
                        throws java.io.IOException
Constructor - set the properties input stream.

Throws:
java.io.IOException

PropertiesConfiguration

public PropertiesConfiguration(java.util.Properties prop)
Constructor - set the properties.

Method Detail

isEmpty

public boolean isEmpty()
Is empty?

Specified by:
isEmpty in interface Configuration

getString

public java.lang.String getString(java.lang.String param)
                           throws FtpException
Get string - if not found throws FtpException.

Specified by:
getString in interface Configuration
Throws:
FtpException

getString

public java.lang.String getString(java.lang.String param,
                                  java.lang.String defaultVal)
Get string - if not found returns the default value.

Specified by:
getString in interface Configuration

getInt

public int getInt(java.lang.String param)
           throws FtpException
Get integer - if not found throws FtpException.

Specified by:
getInt in interface Configuration
Throws:
FtpException

getInt

public int getInt(java.lang.String param,
                  int defaultVal)
Get int - if not found returns the default value.

Specified by:
getInt in interface Configuration

getLong

public long getLong(java.lang.String param)
             throws FtpException
Get long - if not found throws FtpException.

Specified by:
getLong in interface Configuration
Throws:
FtpException

getLong

public long getLong(java.lang.String param,
                    long defaultVal)
Get long - if not found returns the default value.

Specified by:
getLong in interface Configuration

getBoolean

public boolean getBoolean(java.lang.String param)
                   throws FtpException
Get boolean - if not found throws FtpException.

Specified by:
getBoolean in interface Configuration
Throws:
FtpException

getBoolean

public boolean getBoolean(java.lang.String param,
                          boolean defaultVal)
Get boolean - if not found returns the default value.

Specified by:
getBoolean in interface Configuration

getDouble

public double getDouble(java.lang.String param)
                 throws FtpException
Get double - if not found throws FtpException.

Specified by:
getDouble in interface Configuration
Throws:
FtpException

getDouble

public double getDouble(java.lang.String param,
                        double defaultVal)
Get double - if not found returns the default value.

Specified by:
getDouble in interface Configuration

subset

public Configuration subset(java.lang.String param)
Get sub configuration.

Specified by:
subset in interface Configuration

getKeys

public java.util.Iterator<java.lang.String> getKeys()
Get configuration keys.

Specified by:
getKeys in interface Configuration


Copyright © 2003-2008 The Apache Software Foundation. All Rights Reserved.