java.lang.Objectucot.utils.PropertiesTools
public class PropertiesTools
Tools for properties management. Saving and loading from file and such.
Field Summary | |
---|---|
private static java.io.File |
propertiesFile
|
static java.net.URL |
propertiesURL
|
Constructor Summary | |
---|---|
PropertiesTools()
|
Method Summary | |
---|---|
private static java.net.URL |
getPropertiesURL()
Method for creating the URL from the properties file. |
static java.util.Properties |
loadProperties(java.util.Enumeration propertiesKeys)
Method for (re)loading settings from the current properties XML file. |
static java.util.Properties |
loadProperties(java.util.Enumeration propertiesKeys,
java.net.URL propertiesURL)
Method for loading settings from the properties XML file. |
static java.util.Properties |
merge(java.util.Properties overriding,
java.util.Properties virtual)
Method for merging two sets of properties in such a way where overriding properties' values will override any values in virtual properties set that have the same key as in overriding set. |
static void |
saveProperties(java.util.Properties properties)
Method for (re)saving properties to the current properties XML file. |
static void |
saveProperties(java.util.Properties properties,
java.net.URL propertiesURL)
Method for saving current settings to the properties XML file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.io.File propertiesFile
public static final java.net.URL propertiesURL
Constructor Detail |
---|
public PropertiesTools()
Method Detail |
---|
private static java.net.URL getPropertiesURL()
public static java.util.Properties merge(java.util.Properties overriding, java.util.Properties virtual)
overriding
- Overriding properties set.virtual
- Virtual properties set.
public static void saveProperties(java.util.Properties properties, java.net.URL propertiesURL) throws java.io.IOException
properties
- Properties to be saved.propertiesURL
- Target file.
java.io.IOException
public static void saveProperties(java.util.Properties properties) throws java.io.IOException
properties
- Properties to be saved.
java.io.IOException
public static java.util.Properties loadProperties(java.util.Enumeration propertiesKeys, java.net.URL propertiesURL) throws java.io.IOException
propertiesKeys
- Properties' keys that are supposed to be loaded.
If this is null, then all properties in the properties file are returned.propertiesURL
- Target file.
java.io.IOException
public static java.util.Properties loadProperties(java.util.Enumeration propertiesKeys) throws java.io.IOException
propertiesKeys
- Properties' keys that are supposed to be loaded.
java.io.IOException