Jumpi v1.2.0

org.jumpi.impl
Class FileConfigurationLoader

java.lang.Object
  |
  +--org.jumpi.impl.AbstractConfigurationLoader
        |
        +--org.jumpi.impl.ConfigurationLoader
              |
              +--org.jumpi.impl.FileConfigurationLoader
All Implemented Interfaces:
ConfigurationLoader

public class FileConfigurationLoader
extends ConfigurationLoader

Loads property files from either filesystem or classpath, and allows replacement substitution of system property values with specially marked property values. Property values starting with $ are replaced with system properties named after the $.


Field Summary
static java.lang.String PROPERTY_FILE_DEFAULT_VALUE
          Default properties filename.
 
Fields inherited from class org.jumpi.impl.AbstractConfigurationLoader
PROPERTY_SET_KEY, PROPERTY_SYSTEM_PREFIX, REMOVE_PROPERTY
 
Constructor Summary
FileConfigurationLoader()
           
 
Method Summary
protected  void loadPropertySet(java.lang.String propertySetName, java.util.Hashtable props, java.util.Hashtable parameters)
           Load properties from a file, either on the filesystem or on the classpath.
 
Methods inherited from class org.jumpi.impl.ConfigurationLoader
addSystemProperties
 
Methods inherited from class org.jumpi.impl.AbstractConfigurationLoader
getConfiguration, getJumpiClassname, replaceCustomProperties, replaceSystemProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_FILE_DEFAULT_VALUE

public static final java.lang.String PROPERTY_FILE_DEFAULT_VALUE
Default properties filename. Value: jumpi.properties.

See Also:
Constant Field Values
Constructor Detail

FileConfigurationLoader

public FileConfigurationLoader()
Method Detail

loadPropertySet

protected void loadPropertySet(java.lang.String propertySetName,
                               java.util.Hashtable props,
                               java.util.Hashtable parameters)
                        throws java.lang.Exception

Load properties from a file, either on the filesystem or on the classpath. The filename is provided in the propertySetName, which when null, will force the default filename to be loaded. All system properties are added to the returned properties, replacing any properties of the same name already loaded.

If the file is not located relative to the current working directory if it is a relative filename, or at the absolute path if it is an absolute filename, then the file is looked for as a system resource on the classpath. If it still not found then an exception is thrown.

Overrides:
loadPropertySet in class ConfigurationLoader
Parameters:
propertySetName - filename or null to use default filename.
props - the container for the loaded properties.
parameters - customization properties.
Throws:
java.lang.Exception - if the file is not found on classpath or filesystem.

Jumpi v1.2.0

Copyright 2003, Peter Jonathan Klauser.