netx.jnlp.util
Class PropertiesFile
Properties
netx.jnlp.util.PropertiesFile
public class PropertiesFile
extends Properties
A properties object backed by a specified file without throwing
exceptions. The properties are automatically loaded from the
file when the first property is requested, but the save method
must be called before changes are saved to the file.
This class does not report IO exceptions.
(package private) File | file - the file to save to
|
(package private) String | header - the header string
|
(package private) boolean | loaded - lazy loaded on getProperty
|
PropertiesFile(File file) - Create a properties object backed by the specified file.
|
PropertiesFile(File file, String header) - Create a properties object backed by the specified file.
|
String | getProperty(String key) - Returns the value of the specified key, or null if the key
does not exist.
|
String | getProperty(String key, String defaultValue) - Returns the value of the specified key, or the default value
if the key does not exist.
|
File | getStoreFile() - Returns the file backing this properties object.
|
void | load() - Ensures that the file backing these properties has been
loaded; call this method before calling any method defined by
a superclass.
|
Object | setProperty(String key, String value) - Sets the value for the specified key.
|
void | store() - Saves the properties to the file.
|
file
(package private) File file
the file to save to
header
(package private) String header
the header string
loaded
(package private) boolean loaded
lazy loaded on getProperty
PropertiesFile
public PropertiesFile(File file)
Create a properties object backed by the specified file.
file
- the file to save and load to
PropertiesFile
public PropertiesFile(File file,
String header)
Create a properties object backed by the specified file.
file
- the file to save and load toheader
- the file header
getProperty
public String getProperty(String key)
Returns the value of the specified key, or null if the key
does not exist.
getProperty
public String getProperty(String key,
String defaultValue)
Returns the value of the specified key, or the default value
if the key does not exist.
getStoreFile
public File getStoreFile()
Returns the file backing this properties object.
load
public void load()
Ensures that the file backing these properties has been
loaded; call this method before calling any method defined by
a superclass.
setProperty
public Object setProperty(String key,
String value)
Sets the value for the specified key.
store
public void store()
Saves the properties to the file.