public final class Configuration
extends java.lang.Object
| Constructor and Description |
|---|
Configuration()
Create a new Configuration instance loading properties from default location.
|
Configuration(java.lang.String filename)
Create a new Configuration instance loading properties from given location.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
disposeConfiguration()
Dispose the one and only configuration instance.
|
static Configuration |
getInstance()
Get the one and only configuration instance.
|
java.util.Properties |
getProperties()
Get the configured properties.
|
java.lang.String[] |
getProperty(java.lang.String name)
Get property with given name as string array or if property is not available
return an empty string array.
|
boolean |
getProperty(java.lang.String name,
boolean defaultValue)
Get property with given name as boolean value.
|
int |
getProperty(java.lang.String name,
int defaultValue)
Get property with given name as int value.
|
java.lang.String |
getProperty(java.lang.String name,
java.lang.String defaultValue)
Get property with given name as string or if property is not available return
the given default string.
|
void |
loadDefaultProperties()
Load properties from default location.
|
void |
loadProperties(java.lang.String filename)
Load properties from given filename.
|
public Configuration()
public Configuration(java.lang.String filename)
filename - Absolute or relative filename of the properties file.public static Configuration getInstance()
public static void disposeConfiguration()
public void loadDefaultProperties()
public void loadProperties(java.lang.String filename)
filename - Absolute or relative filename of the properties file.public java.util.Properties getProperties()
public java.lang.String getProperty(java.lang.String name,
java.lang.String defaultValue)
name - Name of the property.defaultValue - Default string to return if property is not available.public java.lang.String[] getProperty(java.lang.String name)
name - Name of the property.public int getProperty(java.lang.String name,
int defaultValue)
name - Name of the property.defaultValue - Default int value to return if property is not available or
can not be interpreted as integer.public boolean getProperty(java.lang.String name,
boolean defaultValue)
name - Name of the property.defaultValue - Default boolean value to return if property is not available
or does not equal 'true' or 'false'Intalio Inc. (C) 1999-2006. All rights reserved http://www.intalio.com