|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | 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 of 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
public void load(String fileName) throws ConfigurationException
fileName
- the name of the file loaded
ConfigurationException
public void load(File file) throws ConfigurationException
file
- the loaded file
ConfigurationException
public void load(URL url) throws ConfigurationException
url
- the URL of the file loaded
ConfigurationException
public void load(InputStream in) throws ConfigurationException
getEncoding()
.
in
- the input stream
ConfigurationException
public void load(InputStream in, String encoding) throws ConfigurationException
in
- the input streamencoding
- the encoding used. null
to use the default encoding
ConfigurationException
public void load(Reader in) throws ConfigurationException
in
- the reader
ConfigurationException
public void save() throws ConfigurationException
ConfigurationException
public void save(String fileName) throws ConfigurationException
fileName
-
ConfigurationException
public void save(File file) throws ConfigurationException
file
-
ConfigurationException
public void save(URL url) throws ConfigurationException
url
-
ConfigurationException
public void save(OutputStream out) throws ConfigurationException
getEncoding()
.
out
-
ConfigurationException
public void save(OutputStream out, String encoding) throws ConfigurationException
out
- encoding
-
ConfigurationException
public void save(Writer out) throws ConfigurationException
out
- the writer
ConfigurationException
public 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
- public URL getURL()
public void setURL(URL url)
url
- public 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)
public void reload()
public String getEncoding()
public void setEncoding(String encoding)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |