org.jfree.base.config
public class: PropertyFileConfiguration [javadoc |
source]
java.lang.Object
org.jfree.base.config.HierarchicalConfiguration
org.jfree.base.config.PropertyFileConfiguration
All Implemented Interfaces:
PublicCloneable, ModifiableConfiguration
Direct Known Subclasses:
PackageConfiguration
A report configuration that reads its values from an arbitary property file.
| Method from org.jfree.base.config.PropertyFileConfiguration Summary: |
|---|
|
load, load, load |
| Methods from org.jfree.base.config.HierarchicalConfiguration: |
|---|
|
clone, configurationLoaded, findPropertyKeys, getConfigProperties, getConfigProperty, getConfigProperty, getConfiguration, getParentConfig, insertConfiguration, isLocallyDefined, isParentSaved, setConfigProperty, setParentConfig |
| Method from org.jfree.base.config.PropertyFileConfiguration Detail: |
public void load(String resourceName) {
load(resourceName, PropertyFileConfiguration.class);
}
|
public void load(InputStream in) {
if (in == null)
{
throw new NullPointerException();
}
try
{
final BufferedInputStream bin = new BufferedInputStream(in);
final Properties p = new Properties();
p.load(bin);
this.getConfiguration().putAll(p);
bin.close();
}
catch (IOException ioe)
{
Log.warn("Unable to read configuration", ioe);
}
}
Loads the properties stored in the given file. This method does nothing if
the file does not exist or is unreadable. Appends the contents of the loaded
properties to the already stored contents. |
public void load(String resourceName,
Class resourceSource) {
final InputStream in = ObjectUtilities.getResourceRelativeAsStream
(resourceName, resourceSource);
if (in != null)
{
try
{
load(in);
}
finally
{
try
{
in.close();
}
catch (IOException e)
{
// ignore
}
}
}
else
{
Log.debug ("Configuration file not found in the classpath: " + resourceName);
}
}
Loads the properties stored in the given file. This method does nothing if
the file does not exist or is unreadable. Appends the contents of the loaded
properties to the already stored contents. |