Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

ulu.ut
Class FlexiResourceLoader  view FlexiResourceLoader download FlexiResourceLoader.java

java.lang.Object
  extended byulu.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:

Allows flexible configuration - user can edit their own config files, or just rely on those in the jar.


Field Summary
(package private) static java.lang.String globalconfdir
          relative path to global config directory
(package private) static java.lang.String localconfdir
          relative path to local config directory
 
Constructor Summary
FlexiResourceLoader()
           
 
Method Summary
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
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
static void loadProperties(java.lang.Class marker, java.lang.String propfilepath, java.util.Properties props)
          load a jarred property file into a Property object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

globalconfdir

static java.lang.String globalconfdir
relative path to global config directory


localconfdir

static java.lang.String localconfdir
relative path to local config directory

Constructor Detail

FlexiResourceLoader

public FlexiResourceLoader()
Method Detail

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