public class PropertyUtil extends Object
PropertyUtil
is a util class for all things Properties
.Modifier and Type | Field and Description |
---|---|
static Map<String,Properties> |
CACHED_PROPERTIES |
Constructor and Description |
---|
PropertyUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
getProperty(String propertyFile,
String key)
Gets a string property from a property file.
|
static String |
getProperty(String propertyFile,
String defaultPropertyFile,
String key)
Gets a string property from a property file.
|
static String |
getProperty(String propertyFile,
String defaultPropertyFile,
String key,
String defaultValue)
Gets a string property from a property file.
|
static Properties |
loadPropertyFile(String propertyFile,
String defaultPropertyFile)
Loads property file
Properties . |
public static final Map<String,Properties> CACHED_PROPERTIES
public static String getProperty(String propertyFile, String key)
propertyFile
- the property filekey
- the keypublic static String getProperty(String propertyFile, String defaultPropertyFile, String key)
propertyFile
- the property filedefaultPropertyFile
- the default property filekey
- the keypublic static String getProperty(String propertyFile, String defaultPropertyFile, String key, String defaultValue)
propertyFile
- the property filedefaultPropertyFile
- the default property filekey
- the keydefaultValue
- the default value (if the desired property wasn't found, then this is returned)public static Properties loadPropertyFile(String propertyFile, String defaultPropertyFile)
Properties
.propertyFile
- the property file namedefaultPropertyFile
- the default property file name