|
IMC Epclient 5.0.3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectat.spardat.enterprise.util.Props
This class is used by non-application-classes that want to access system-properties, but do not want to define them using -Dkey=value on the command line. Instead they may just specify the define
-Denterprise.propertyFile=c:/javadev/myproject/config/ep.propertiesIn this case, the properties are loaded from the filesystem. Alternatively, you may specify a path to load the file from the application-jar-file
-Denterprise.propertyFile=/at/spardat/someProj/ep.propertiesby specifying a property-file that is loadable from the applications classloader. That classloader must be the same classloader the enterprise-classes are loaded from.
Either way, all properties found in the file are inserted as system-properties before the getProperty-methods of this class are called.
| Constructor Summary | |
Props()
|
|
| Method Summary | |
static java.lang.String |
getProperty(java.lang.String key)
Returns a system-property for a given key or null if there is no such property set. |
static java.lang.String |
getProperty(java.lang.String key,
java.lang.String def)
Returns the system-property for a given key. |
static java.lang.String |
getPropertySafe(java.lang.String key)
Returns a system-property for a given key and throws a RuntimeException if the property is not set. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Props()
| Method Detail |
public static java.lang.String getProperty(java.lang.String key)
key - the key for the requested property
public static java.lang.String getPropertySafe(java.lang.String key)
key - the key for the requested property
SysException - if no property found
public static java.lang.String getProperty(java.lang.String key,
java.lang.String def)
key - the property-keydef - the default-value that should be returned if the property with
key is not found.
|
IMC Epclient 5.0.3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||