|
DLESE Tools v1.2 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.Dictionary java.util.Hashtable java.util.Properties org.dlese.dpc.propertiesmgr.PropertiesManager
DESCRIPTION
Field Summary |
---|
Fields inherited from class java.util.Properties |
---|
defaults |
Constructor Summary | |
---|---|
PropertiesManager()
Create an unloaded Properties object. |
|
PropertiesManager(String propsFileName)
Create and load this Properties hash map from the given Properties file or properties reaource located in the jar |
Method Summary | |
---|---|
String |
getProp(String property,
String defaultValue)
Retrieves the property value from this object's property file. |
boolean |
getPropAsBoolean(String property,
String defaultValue)
Same as the getProp(String,String) method only it returns it's
parameter as a boolean. |
int |
getPropAsInt(String property,
String defaultValue)
Same as the getProp(String,String) method only it returns it's
parameter as an integer. |
void |
writePropsFile()
Writes the properties to the same file that was used to read them, preserving any comments in the file. |
void |
writePropsFile(String propsFilePath)
Writes the properties to the given file 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 |
public PropertiesManager()
public PropertiesManager(String propsFileName) throws IOException
propsFileName
- The name of the Properties file to load or URL to
the properties location inside a jar
IOException
- If unable to load the properties.Method Detail |
public void writePropsFile() throws IOException
IOException
- If error in input/outputpublic void writePropsFile(String propsFilePath) throws IOException
propsFilePath
- The full path to the props file to be written.
IOException
- If error in input/outputpublic String getProp(String property, String defaultValue) throws Exception
property
- The property sting to retrievedefaultValue
- The default value for this property, if none is found
Exception
- DESCRIPTIONpublic int getPropAsInt(String property, String defaultValue) throws Exception
getProp(String,String)
method only it returns it's
parameter as an integer.
property
- DESCRIPTIONdefaultValue
- DESCRIPTION
Exception
- DESCRIPTIONpublic boolean getPropAsBoolean(String property, String defaultValue) throws Exception
getProp(String,String)
method only it returns it's
parameter as a boolean. Possible inputs are
[yes|no|true|false|on|off|enabled|disabled].
property
- DESCRIPTIONdefaultValue
- DESCRIPTION
Exception
- DESCRIPTION
|
DLESE Tools v1.2 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |