|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A persistent configuration loaded and saved to a file.
Method Summary | |
String |
getBasePath()
Return the base path. |
String |
getEncoding()
Return the encoding used to store the configuration file. |
File |
getFile()
Return the file where the configuration is stored. |
String |
getFileName()
Return the name of the file. |
ReloadingStrategy |
getReloadingStrategy()
Return the reloading strategy. |
URL |
getURL()
Return the URL where the configuration is stored. |
boolean |
isAutoSave()
Tells if properties are automatically saved to the disk. |
void |
load()
Load the configuration from the underlying URL. |
void |
load(File file)
Load the configuration from the specified file. |
void |
load(InputStream in)
Load the configuration from the specified stream, using the encoding returned by getEncoding() . |
void |
load(InputStream in,
String encoding)
Load the configuration from the specified stream, using the specified encoding. |
void |
load(Reader in)
Load the configuration from the specified reader. |
void |
load(String fileName)
Locate the specified file and load the configuration. |
void |
load(URL url)
Load the configuration from the specified URL. |
void |
reload()
Reload the configuration. |
void |
save()
Save the configuration. |
void |
save(File file)
Save the configuration to the specified file. |
void |
save(OutputStream out)
Save the configuration to the specified stream, using the encoding returned by getEncoding() . |
void |
save(OutputStream out,
String encoding)
Save the configuration to the specified stream, using the specified encoding. |
void |
save(String fileName)
Save the configuration to the specified file. |
void |
save(URL url)
Save the configuration to the specified URL if it's a file URL. |
void |
save(Writer out)
Save the configuration to the specified writer. |
void |
setAutoSave(boolean autoSave)
Enable or disable the automatical saving of modified properties to the disk. |
void |
setBasePath(String basePath)
Set the base path. |
void |
setEncoding(String encoding)
Set the encoding used to store the configuration file. |
void |
setFile(File file)
Set the file where the configuration is stored. |
void |
setFileName(String fileName)
Set the name of the file. |
void |
setReloadingStrategy(ReloadingStrategy strategy)
Set the reloading strategy. |
void |
setURL(URL url)
The URL where the configuration is stored. |
Methods inherited from interface org.apache.commons.configuration.Configuration |
addProperty, clear, clearProperty, containsKey, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getDouble, getDouble, getDouble, getFloat, getFloat, getFloat, getInt, getInt, getInteger, getKeys, getKeys, getList, getList, getLong, getLong, getLong, getProperties, getProperty, getShort, getShort, getShort, getString, getString, getStringArray, isEmpty, setProperty, subset |
Method Detail |
public void load() throws ConfigurationException
ConfigurationException
- if an error occurs during the load operationpublic void load(String fileName) throws ConfigurationException
fileName
- the name of the file loadedConfigurationException
- if an error occurs during the load operationpublic void load(File file) throws ConfigurationException
file
- the loaded fileConfigurationException
- if an error occurs during the load operationpublic void load(URL url) throws ConfigurationException
url
- the URL of the file loadedConfigurationException
- if an error occurs during the load operationpublic void load(InputStream in) throws ConfigurationException
getEncoding()
.in
- the input streamConfigurationException
- if an error occurs during the load operationpublic void load(InputStream in, String encoding) throws ConfigurationException
in
- the input streamencoding
- the encoding used. null
to use the default encodingConfigurationException
- if an error occurs during the load operationpublic void load(Reader in) throws ConfigurationException
in
- the readerConfigurationException
- if an error occurs during the load operationpublic void save() throws ConfigurationException
ConfigurationException
- if an error occurs during the save operationpublic void save(String fileName) throws ConfigurationException
fileName
- the name of the file to be savedConfigurationException
- if an error occurs during the save operationpublic void save(File file) throws ConfigurationException
file
- specifies the file to be savedConfigurationException
- if an error occurs during the save operationpublic void save(URL url) throws ConfigurationException
url
- the URLConfigurationException
- if an error occurs during the save operationpublic void save(OutputStream out) throws ConfigurationException
getEncoding()
.out
- the output streamConfigurationException
- if an error occurs during the save operationpublic void save(OutputStream out, String encoding) throws ConfigurationException
out
- the output streamencoding
- the encoding to be usedConfigurationException
- if an error occurs during the save operationpublic void save(Writer out) throws ConfigurationException
out
- the writerConfigurationException
- if an error occurs during the save operationpublic String getFileName()
public void setFileName(String fileName)
fileName
- the name of the filepublic String getBasePath()
public void setBasePath(String basePath)
basePath
- the base path.public File getFile()
public void setFile(File file)
file
- the filepublic URL getURL()
public void setURL(URL url)
url
- the URLpublic void setAutoSave(boolean autoSave)
autoSave
- true
to enable, false
to disablepublic boolean isAutoSave()
true
if auto-saving is enabled, false
otherwisepublic ReloadingStrategy getReloadingStrategy()
public void setReloadingStrategy(ReloadingStrategy strategy)
strategy
- the reloading strategy to usepublic void reload()
public String getEncoding()
public void setEncoding(String encoding)
encoding
- the encoding to use
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |