|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.townleyenterprises.common.ConfigLoader
This class provides the main mechanism of loading configuration files so that I don't have to have the exact same code in more than one place.
Constructor Summary | |
ConfigLoader(java.lang.Class cls,
java.lang.String primaryloc,
java.lang.String secondaryloc)
The constructor takes the primary and secondary locations of the properties to be loaded. |
Method Summary | |
boolean |
equals(java.lang.Object o)
Checks for equality based on the values of the constructor attributes. |
java.util.Properties |
getProperties()
This method allows access to all of the property values so that external code can be configured from the unified properties. |
java.lang.String |
getProperty(java.lang.String name)
This method returns the appropriate property value. |
java.lang.String |
getProperty(java.lang.String prefix,
java.lang.String name)
Alternative method that provides a prefix in addition to the specific parameter to retrieve. |
java.lang.String |
toString()
This method prints information about this configuration loader instance. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ConfigLoader(java.lang.Class cls, java.lang.String primaryloc, java.lang.String secondaryloc) throws java.io.IOException
primaryloc
- the primary location (usually, just the
name of the properties file)secondaryloc
- the secondary location (usually, the
same name prefixed with a '/' so that it can be placed
in the classes directory of the servlet container)
java.io.IOException
- if there was a problem accessing the propertiesMethod Detail |
public java.lang.String getProperty(java.lang.String name)
name
- the parameter key
public java.lang.String getProperty(java.lang.String prefix, java.lang.String name)
prefix
- the prefixname
- the actual param name
public java.util.Properties getProperties()
public java.lang.String toString()
public boolean equals(java.lang.Object o)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |