public class PropertiesFile
extends java.util.Properties
Constructor and Description |
---|
PropertiesFile(java.io.File file)
Create a properties object backed by the specified file.
|
PropertiesFile(java.io.File file,
java.lang.String header)
Create a properties object backed by the specified file.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getProperty(java.lang.String key)
Returns the value of the specified key, or null if the key
does not exist.
|
java.lang.String |
getProperty(java.lang.String key,
java.lang.String defaultValue)
Returns the value of the specified key, or the default value
if the key does not exist.
|
java.io.File |
getStoreFile()
Returns the file backing this properties object.
|
boolean |
load()
Ensures that the file backing these properties has been
loaded; call this method before calling any method defined by
a superclass.
|
java.lang.Object |
setProperty(java.lang.String key,
java.lang.String value)
Sets the value for the specified key.
|
void |
store()
Saves the properties to the file.
|
list, list, load, load, loadFromXML, propertyNames, save, store, store, storeToXML, storeToXML, stringPropertyNames
clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keys, keySet, merge, put, putAll, putIfAbsent, rehash, remove, remove, replace, replace, replaceAll, size, toString, values
public PropertiesFile(java.io.File file)
file
- the file to save and load topublic PropertiesFile(java.io.File file, java.lang.String header)
file
- the file to save and load toheader
- the file headerpublic java.lang.String getProperty(java.lang.String key)
getProperty
in class java.util.Properties
public java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
getProperty
in class java.util.Properties
public java.lang.Object setProperty(java.lang.String key, java.lang.String value)
setProperty
in class java.util.Properties
public java.io.File getStoreFile()
public boolean load()
public void store()