net.sf.colle.util
Class DomainProperties
java.lang.Object
net.sf.colle.util.DomainProperties
- public class DomainProperties
- extends Object
Uses a simple algorithm to locate domain qualified properties such as
com.example.sub.system.color. The following locations will be searched in
the following order (first match ends search):
1. If defined, System.getProperty("com.example.sub.system.color") is used
and the search ends.
2. ClassLoader.getResourceAsStream("com.example.sub.system.properties") is
used to load a properties file and "color" property is queried.
3. Step 2 is repeated for each parent domain (eg:
"com.example.sub.properties", "com.example.properties", "com.properties").
The property name queried is the remaining original property name (eg:
"system.color", "sub.system.color", "example.sub.system.color").
If the same properties are defined in multiple property files (e.g.:
com.example.sub.properties contains system.color and com.example.properties
contains sub.system.color, then the outer most property file takes
precedence (e.g.: com.example.properties). Care should be taken when
multiple class loaders are in use (J2EE) as some class loaders may have
different visibilty to different property files.
Created: 23 Aug 2004
- Version:
- $Revision: 1.3 $, $Date: 2004/12/17 06:59:24 $
- Author:
- Dwayne Schultz
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
getProperty
public static String getProperty(String psFullName)
getProperty
public static String getProperty(String psFullName,
String psDefault)
loadProperties
public static void loadProperties(String psFullName)