org.apache.commons.configuration
public interface FileConfiguration extends Configuration
Since: 1.0-rc2
Version: $Revision: 492234 $, $Date: 2007-01-03 18:39:39 +0100 (Mi, 03 Jan 2007) $
Method Summary | |
---|---|
String | getBasePath()
Returns 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(String fileName)
Locate the specified file and load the configuration.
|
void | load(File file)
Load the configuration from the specified file.
|
void | load(URL url)
Load the configuration from the specified URL.
|
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 | reload()
Reload the configuration.
|
void | save()
Save the configuration.
|
void | save(String fileName)
Save the configuration to the specified file.
|
void | save(File file)
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(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(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)
Sets 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.
|
setFile()
or setURL()
were used, the base
path typically points to the parent directory of the configuration file
(e.g. for the URL file:/temp/test.properties
the base path
will be file:/temp/
). If the base path was explictly set
using setBasePath()
, this method will return the exact
value specified here without further modifications.
Returns: the base path
See Also: setBasePath
Returns: the current encoding
Since: 1.1
Returns: the configuration file
Returns: the file name
Returns: the reloading strategy currently used
Since: 1.1
Returns: the URL of the configuration
Returns: true
if auto-saving is enabled, false
otherwise
Since: 1.1
Throws: ConfigurationException if an error occurs during the load operation
Parameters: fileName the name of the file loaded
Throws: ConfigurationException if an error occurs during the load operation
Parameters: file the loaded file
Throws: ConfigurationException if an error occurs during the load operation
Parameters: url the URL of the file loaded
Throws: ConfigurationException if an error occurs during the load operation
Parameters: in the input stream
Throws: ConfigurationException if an error occurs during the load operation
Parameters: in the input stream encoding the encoding used. null
to use the default encoding
Throws: ConfigurationException if an error occurs during the load operation
Parameters: in the reader
Throws: ConfigurationException if an error occurs during the load operation
Since: 1.1
Throws: ConfigurationException if an error occurs during the save operation
Parameters: fileName the name of the file to be saved
Throws: ConfigurationException if an error occurs during the save operation
Parameters: file specifies the file to be saved
Throws: ConfigurationException if an error occurs during the save operation
Parameters: url the URL
Throws: ConfigurationException if an error occurs during the save operation
Parameters: out the output stream
Throws: ConfigurationException if an error occurs during the save operation
Parameters: out the output stream encoding the encoding to be used
Throws: ConfigurationException if an error occurs during the save operation
Parameters: out the writer
Throws: ConfigurationException if an error occurs during the save operation
Parameters: autoSave true
to enable, false
to disable
Since: 1.1
setBasePath()
and
setFileName()
can be used together to specify the location
of the configuration file to be loaded. If relative file names are to
be resolved (e.g. for the include files supported by
PropertiesConfiguration
), this base path will be used.
Parameters: basePath the base path.
Parameters: encoding the encoding to use
Since: 1.1
Parameters: file the file
Parameters: fileName the name of the file
Parameters: strategy the reloading strategy to use
Since: 1.1
Parameters: url the URL