public class FilePropertyMgr extends PropertyMgr
java.util.Property
does not trim whitespace from
values, so "x = y " will return "y ", which is hard to
debug).
ThreadSafety: This class is thread safe and can be used by multiple threads concurrently.
Constructor and Description |
---|
FilePropertyMgr(java.io.File propertyFile) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
get(java.lang.String name)
Returns the property associated with the specified key or null
if the property was not found.
|
static void |
main(java.lang.String[] args) |
void |
save()
Saves any properties that were set previously.
|
java.lang.String |
set(java.lang.String name,
java.lang.String value)
Sets the property associated with the specified key.
|
java.lang.String |
toString()
Returns a description but the exact details of said description
are unspecified and subject to change.
|
get, getBoolean, getInt, getRequired, getRequiredBoolean, getRequiredInt, setUsage
public FilePropertyMgr(java.io.File propertyFile) throws java.io.IOException
java.io.IOException
public java.lang.String get(java.lang.String name)
PropertyMgr
get
in class PropertyMgr
name
- the property keypublic java.lang.String set(java.lang.String name, java.lang.String value)
PropertyMgr
set
in class PropertyMgr
name
- the property keyvalue
- the property valuepublic void save() throws java.io.IOException
PropertyMgr
save
in class PropertyMgr
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)