|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Dictionary<K,V>
java.util.Hashtable<java.lang.Object,java.lang.Object>
java.util.Properties
simple.util.FileProperties
public class FileProperties
The FileProperties
object is used as a convienience
class that is used to create a Properties
object
from a file path. This will automatically load the Java property
file once instantiated. This is used so that the creation and
use of a java.util.Properties
file is much cleaner.
Field Summary |
---|
Fields inherited from class java.util.Properties |
---|
defaults |
Constructor Summary | |
---|---|
FileProperties(java.io.File source)
Constructor for the FileProperties object. |
|
FileProperties(java.io.File base,
java.lang.String source)
Constructor for the FileProperties object. |
|
FileProperties(java.lang.String source)
Constructor for the FileProperties object. |
Method Summary | |
---|---|
void |
load(java.io.InputStream source)
This overloads the Properties.load so that XML
properties can be loaded as well as standard properties. |
Methods inherited from class java.util.Properties |
---|
getProperty, getProperty, list, list, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNames |
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 |
---|
public FileProperties(java.lang.String source) throws java.io.IOException
FileProperties
object. The
constructor will use the specified file as the contents of
its properties. The file name should be absolute, and in an
OS specific format. For example "C:\data.properties" on a
Windows filesystem, and "/pub/bin/data.properties" on UNIX.
source
- this is the file that contains the properties
java.io.IOException
- if the properties can not be loadedpublic FileProperties(java.io.File base, java.lang.String source) throws java.io.IOException
FileProperties
object. The
constructor will use the specified base path to load the
named properties file from. The file name given should be
relative to the issued base path. This is a convinience
method that enables the Java properties file to be loaded
without the need to specify an OS specific file path.
base
- this is the directory to loade the file fromsource
- this is the file that contains the properties
java.io.IOException
- if the properties can not be loadedpublic FileProperties(java.io.File source) throws java.io.IOException
FileProperties
object. The
constructor will use the specified file as the contents of
its properties. The file name should be absolute, and in an
OS specific format. For example "C:\data.properties" on a
Windows filesystem, and "/pub/bin/data.properties" on UNIX.
source
- this is the file that contains the properties
java.io.IOException
- if the properties can not be loadedMethod Detail |
---|
public void load(java.io.InputStream source) throws java.io.IOException
Properties.load
so that XML
properties can be loaded as well as standard properties.
Once this method is invoked the stream is examined to see
if the properties format is in XML. If the file is a valid
XML file then the properties are loaded int he XML format.
Otherwise they are loaded using the traditional format.
load
in class java.util.Properties
source
- the stream that contains the properties
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |