|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.crosswire.common.util.ResourceUtil
public final class ResourceUtil
Better implementations of the getResource methods with less ambiguity and that are less dependent on the specific classloader situation.
for license details.
The copyright to this program is held by it's authors.
Constructor Summary | |
---|---|
private |
ResourceUtil()
Prevent Instantiation |
Method Summary | ||
---|---|---|
static
|
getProperties(Class<T> clazz)
Get and load a properties file from the writable area or if that fails from the classpath (where a default ought to be stored) |
|
private static
|
getProperties(Class<T> clazz,
String subject)
Get and load a properties file from the writable area or if that fails from the classpath (where a default ought to be stored) |
|
static PropertyMap |
getProperties(String subject)
Get and load a properties file from the writable area or if that fails from the classpath (where a default ought to be stored) |
|
static
|
getResource(Class<T> clazz,
String resourceName)
Generic resource URL fetcher. |
|
static URL |
getResource(String search)
Generic resource URL fetcher. |
|
static
|
getResourceAsStream(Class<T> clazz,
String search)
Generic resource URL fetcher |
|
static InputStream |
getResourceAsStream(String search)
Generic resource URL fetcher |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
private ResourceUtil()
Method Detail |
---|
public static URL getResource(String search) throws MissingResourceException
search
- The name of the resource (without a leading /) to find
MissingResourceException
- if the resource can not be foundpublic static <T> URL getResource(Class<T> clazz, String resourceName) throws MissingResourceException
clazz
- The resource to find
MissingResourceException
- if the resource can not be foundpublic static InputStream getResourceAsStream(String search) throws IOException, MissingResourceException
IOException
- if there is a problem reading the file
MissingResourceException
- if the resource can not be foundpublic static <T> InputStream getResourceAsStream(Class<T> clazz, String search) throws IOException, MissingResourceException
IOException
- if there is a problem reading the file
MissingResourceException
- if the resource can not be foundpublic static PropertyMap getProperties(String subject) throws IOException
subject
- The name of the desired resource (without any extension)
IOException
- if the resource can not be loaded
MissingResourceException
- if the resource can not be foundpublic static <T> PropertyMap getProperties(Class<T> clazz) throws IOException
clazz
- The name of the desired resource
IOException
- if the resource can not be loaded
MissingResourceException
- if the resource can not be foundprivate static <T> PropertyMap getProperties(Class<T> clazz, String subject) throws IOException
clazz
- The name of the desired resource
IOException
- if the resource can not be loaded
MissingResourceException
- if the resource can not be found
|
Copyright ? 2003-2011 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |