public class PropertyUtils
extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
protected |
PropertyUtils()
Don't allow instantiation, do allow overrides.
|
| Modifier and Type | Method and Description |
|---|---|
static java.util.Properties |
loadProperties(java.lang.String propertiesFileName)
Load properties from a specified file.
|
static java.util.Properties |
loadProperties(java.net.URL propertiesURL)
Load properties from a specified URL.
|
static java.util.Properties |
loadPropertiesFromString(java.lang.String propertiesString)
Load properties from a string.
|
static void |
saveProperties(java.util.Properties properties,
java.lang.String propertiesFileName,
java.lang.String header)
Save properties to a specified file.
|
static void |
savePropertiesToString(java.util.Properties properties,
java.lang.String propertiesString,
java.lang.String header)
Saves properties to a specified string.
|
protected PropertyUtils()
public static java.util.Properties loadProperties(java.lang.String propertiesFileName)
throws java.io.IOException,
java.io.FileNotFoundException
propertiesFileName - File name of properties file to read.java.io.FileNotFoundException - if properties file not found.java.io.IOException - if properties file cannot be read.public static java.util.Properties loadProperties(java.net.URL propertiesURL)
throws java.io.IOException,
java.io.FileNotFoundException
propertiesURL - URL of properties file to read.java.io.IOException - if properties file cannot be read.java.io.FileNotFoundExceptionpublic static void saveProperties(java.util.Properties properties,
java.lang.String propertiesFileName,
java.lang.String header)
throws java.io.IOException
properties - Properties collection to save.propertiesFileName - Name of file to save to.header - Header line describing properties.java.io.IOException - if properties file cannot be saved.public static java.util.Properties loadPropertiesFromString(java.lang.String propertiesString)
throws java.io.IOException
propertiesString - String containing properties to read.java.io.IOException - if properties cannot be read from string.public static void savePropertiesToString(java.util.Properties properties,
java.lang.String propertiesString,
java.lang.String header)
throws java.io.IOException
properties - -- properties collection to save.header - -- header line describing properties.java.io.IOException - if properties cannot be saved to string.