public class FilePropertyIO extends AbstractFilePropertyIO
File
using Properties.load
method.File
,
Properties
,
Properties.load(java.io.Reader)
,
Serialized FormConstructor and Description |
---|
FilePropertyIO(File file)
Returns a
FilePropertyIO with loads properties from the file . |
FilePropertyIO(File file,
boolean readonly)
Returns a
FilePropertyIO with loads properties from the file . |
FilePropertyIO(File file,
boolean readonly,
boolean cached)
Returns a
FilePropertyIO with loads properties from the file . |
Modifier and Type | Method and Description |
---|---|
CommentedProperties |
getCommentedProperties()
Gets the CommentedProperties instance, whre both Properties and their comments are stored.
|
Properties |
getProperties()
Gets all the name,value pair in a Properties class instance.
|
void |
reload()
Reloads the name,value pairs for the PropertyIO, or forces the values to reload when read next time.
|
void |
setValue(String propertyName,
String value)
Sets the name,value as String in the IO.
|
getFile, getName, getSource, validate
backup, getCacheTime, getLastLoaded, getLastSaved, getLogger, getTypedProperties, getTypedValue, getValue, isCached, isReadonly, logPerformanceGetProperties, logPerformanceSetValue, setCacheTime, storeTypedValue, updateLastLoaded, updateLastSaved, validateWritable
public FilePropertyIO(File file)
FilePropertyIO
with loads properties from the file
. false
and cached is set to true
.file
- the file
to load properties from.public FilePropertyIO(File file, boolean readonly)
FilePropertyIO
with loads properties from the file
.
Attributes cached is set to true
.file
- the file
to load properties from.readonly
- is the FilePropertyIO
to be read only.public FilePropertyIO(File file, boolean readonly, boolean cached)
FilePropertyIO
with loads properties from the file
.file
- readonly
- is the FilePropertyIO
to be read only.cached
- shall the values be cached in the PropertyIO
's.public void setValue(String propertyName, String value) throws PropertyIOException
PropertyIO
propertyName
- the name of the propertyvalue
- the string value of the property.PropertyIOException
- if the IO is readonly or failed to write the value.public void reload()
PropertyIO
reload
in interface PropertyIO
reload
in class AbstractPropertyIO
public final CommentedProperties getCommentedProperties()
public Properties getProperties()
PropertyIO
Properties