public final class ResourceUtil extends Object
The GNU Lesser General Public License for details.| Modifier | Constructor and Description |
|---|---|
private |
ResourceUtil()
Prevent Instantiation
|
| Modifier and Type | Method and Description |
|---|---|
static <T> PropertyMap |
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 <T> PropertyMap |
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 <T> URL |
getResource(Class<T> clazz,
String resourceName)
Generic resource URL fetcher.
|
static URL |
getResource(String search)
Generic resource URL fetcher.
|
static <T> InputStream |
getResourceAsStream(Class<T> clazz,
String search)
Generic resource URL fetcher
|
static InputStream |
getResourceAsStream(String search)
Generic resource URL fetcher
|
public static URL getResource(String search) throws MissingResourceException
search - The name of the resource (without a leading /) to findMissingResourceException - if the resource can not be foundpublic static <T> URL getResource(Class<T> clazz, String resourceName) throws MissingResourceException
T - the type of the resourceclazz - the basis to search for the resource first.resourceName - The resource to findMissingResourceException - if the resource can not be foundpublic static InputStream getResourceAsStream(String search) throws IOException, MissingResourceException
search - The name of the resource (without a leading /) to findIOException - if there is a problem reading the fileMissingResourceException - if the resource can not be foundpublic static <T> InputStream getResourceAsStream(Class<T> clazz, String search) throws IOException, MissingResourceException
T - the type of the resourceclazz - the basis to search for the resource first.search - The name of the resource (without a leading /) to findIOException - if there is a problem reading the fileMissingResourceException - 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 loadedpublic static <T> PropertyMap getProperties(Class<T> clazz) throws IOException
T - the type of the resourceclazz - The name of the desired resourceIOException - if the resource can not be loadedprivate static <T> PropertyMap getProperties(Class<T> clazz, String subject) throws IOException
T - the type of the resourceclazz - The name of the desired resourcesubject - The name of the desired resource (without any extension)IOException - if the resource can not be loaded