public class ConfigFile extends Config
kiwi.util.Config
, adding convenience methods for saving a
property list to a file, and reading a property list from a file.Properties
,
Config
,
Serialized FormModifier and Type | Field and Description |
---|---|
private File |
file |
description, psupport, support
defaults
Constructor and Description |
---|
ConfigFile(File file)
Construct a new
ConfigFile with a default comment. |
ConfigFile(File file,
String comment)
Construct a new
ConfigFile . |
Modifier and Type | Method and Description |
---|---|
String |
getPath()
Get the absolute path of this configuration file.
|
void |
load()
Load the configuration parameters from the file.
|
void |
store()
Save the configuration parameters to the file.
|
addChangeListener, addPropertyChangeListener, clear, getBoolean, getBoolean, getColor, getColor, getDescription, getFont, getFont, getInt, getInt, getObject, getString, getString, list, put, putBoolean, putColor, putFont, putInt, putObject, putString, remove, removeChangeListener, removePropertyChangeListener, setDescription
getProperty, getProperty, list, list, load, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNames
clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keys, keySet, merge, putAll, putIfAbsent, rehash, remove, replace, replace, replaceAll, size, toString, values
public ConfigFile(File file, String comment)
ConfigFile
. Note that the object has to be
initialized by explicitly loading the properties via a call to
load()
; the constructor does not preload the file.file
- The File
object for this configuration file.comment
- The top-of-file comment (one line).public ConfigFile(File file)
ConfigFile
with a default comment. Note that
the object has to be initialized by explicitly loading the properties
via a call to load()
; the constructor does not preload the
file.file
- The File
object for this configuration file.public void load() throws FileNotFoundException, IOException
ChangeEvent
to notify listeners that the object
(potentially) changed.FileNotFoundException
- If the associated file does not
exist.IOException
- If the file could not be read.store()
public void store() throws IOException
IOException
- If the file could not be written.load()
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses