opencard.opt.util
Class OpenCardPropertyFileLoader
java.lang.Object
|
+--opencard.opt.util.OpenCardPropertyFileLoader
- public class OpenCardPropertyFileLoader
- extends java.lang.Object
- implements opencard.core.util.OpenCardConfigurationProvider
OpenCardPropertyFileLoader is a utility class that loads the
opencard.properties file and merges the properties found in there
with the system properties. Usually system properties will override properties found
in the opencard.properties file. In case a property from the
opencard.properties should override a system property you will have to use a second
property using the first property's name plus the suffix .override and set it to
true, e.g.
OpenCard.trace = opencard.core:8
To let this property always override the system property of the same name add
OpenCard.trace.override = true
- See Also:
OpenCardConfigurationProvider
Method Summary |
protected void |
load(java.lang.String location)
Tries to load a property file from location. |
void |
loadProperties()
Loads OpenCard properties from a property file. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
OpenCardPropertyFileLoader
public OpenCardPropertyFileLoader()
load
protected void load(java.lang.String location)
- Tries to load a property file from location.
- Parameters:
location
- The path to the property file location.
loadProperties
public void loadProperties()
throws opencard.core.util.OpenCardPropertyLoadingException
- Loads OpenCard properties from a property file. The following locations will
be searched for a properties file (in that order):
- [java.home]/lib/opencard.properties
- [user.home]/.opencard.properties
- [user.dir]/opencard.properties
- [user.dir]/.opencard.properties
NOTE that if a property file exists in several of these locations each one is
being read. Conceptually this makes it possible to have a general property file, say
in user.home, and more specific ones in the current directories which
extend the general one.
java.home is the directory of your java installation, user.home
the user's home directory, and user.dir the current working directory.
- Specified by:
- loadProperties in interface opencard.core.util.OpenCardConfigurationProvider
- Throws:
- opencard.core.util.OpenCardPropertyLoadingException - thrown when no property file could be found