com.ds.fw.resources
Class FwProperties

java.lang.Object
  |
  +--java.util.Dictionary
        |
        +--java.util.Hashtable
              |
              +--java.util.Properties
                    |
                    +--com.ds.fw.resources.FwProperties
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

public class FwProperties
extends java.util.Properties

The purpose of this class is to load a property file and then to extract a property value by its key.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.Properties
defaults
 
Constructor Summary
FwProperties()
          Constructor.
FwProperties(java.io.InputStream in)
          Constructor.
FwProperties(java.util.Locale inLocale)
          Constructor.
FwProperties(java.lang.String pfile)
          Constructor.
 
Method Summary
 java.lang.Object getObject(java.lang.String key)
          Gets a property value by its key.
 java.lang.String getString(java.lang.String key)
          Gets a property value as a string by its key.
 java.io.InputStream loadStream(java.io.InputStream in)
          Loads a property file from a InputStream.
 java.io.InputStream loadStream(java.lang.String pfile)
          Loads a property file.
 java.io.InputStream loadStream1(java.lang.String pfile)
          Loads a property file from the base path.
 
Methods inherited from class java.util.Properties
getProperty, getProperty, list, list, load, propertyNames, save, setProperty, store
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FwProperties

public FwProperties(java.lang.String pfile)
             throws java.io.IOException
Constructor.

Parameters:
pfile - the property file to be load
Throws:
java.io.IOException - if the file could not be open

FwProperties

public FwProperties(java.util.Locale inLocale)
             throws java.io.IOException
Constructor.

Parameters:
inLocale - the locale which default property file will be loaded
Throws:
java.io.IOException - if the file could not be open

FwProperties

public FwProperties()
             throws java.io.IOException
Constructor. Loads the default property file.

Throws:
java.io.IOException - if the file could not be open

FwProperties

public FwProperties(java.io.InputStream in)
             throws java.io.IOException
Constructor. Loads the property file from an InputStream.

Parameters:
in - the input stream
Throws:
java.io.IOException - if the stream could not be opened
Method Detail

loadStream1

public java.io.InputStream loadStream1(java.lang.String pfile)
Loads a property file from the base path.

Parameters:
pfile - file name
Returns:
an opened InputStream

loadStream

public java.io.InputStream loadStream(java.lang.String pfile)
Loads a property file.

Parameters:
pfile - file to load
Returns:
an InputStream

loadStream

public java.io.InputStream loadStream(java.io.InputStream in)
Loads a property file from a InputStream.

Parameters:
in - the stream to be opened
Returns:
an opened InputStream

getString

public java.lang.String getString(java.lang.String key)
Gets a property value as a string by its key.

Parameters:
key - property key
Returns:
the property value

getObject

public java.lang.Object getObject(java.lang.String key)
Gets a property value by its key.

Parameters:
key - property key
Returns:
the property value