ulu.ut
Class FlexiResourceLoader

java.lang.Object
ulu.ut.FlexiResourceLoader
- public class FlexiResourceLoader
- extends java.lang.Object
utility class for loading resources from jar files or from local filesystem, using a
simple preferences algorithm:
- if its in $USER_HOME/conf, use that
- if not, if its in ./conf/, use that
- if not, look in jar file for default conf file
Allows flexible configuration - user can edit their own config files, or just rely on those
in the jar.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
globalconfdir
static java.lang.String globalconfdir
- relative path to global config directory
localconfdir
static java.lang.String localconfdir
- relative path to local config directory
FlexiResourceLoader
public FlexiResourceLoader()
getURL
public static java.net.URL getURL(java.lang.Class marker,
java.lang.String path)
- get a URL for a jarred item based on a marker class used to identify
the jar file
getStream
public static java.io.InputStream getStream(java.lang.Class marker,
java.lang.String path)
- get the content stream for a jarred item based on a marker class
used to identify the jar file
loadProperties
public static void loadProperties(java.lang.Class marker,
java.lang.String propfilepath,
java.util.Properties props)
throws java.io.IOException
- load a jarred property file into a Property object