public abstract class MyResource
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getPackageResourceBaseName(java.lang.Class<? extends java.lang.Object> clazz,
java.lang.String resourceTypeName)
Gets the base name for the resource of the indicated type corresponding to the package of the given class.
|
static java.lang.String |
getResourceBaseName(java.lang.Class<? extends java.lang.Object> clazz,
java.lang.String resourceTypeName)
Gets the base name for the resource of the indicated type corresponding to the given class.
|
static java.io.InputStream |
getResourceInputStream(java.lang.Class<?> clazz,
java.lang.String resourceName)
Attempts to find a resource of the given name, and returns an input stream for reading that resource if it can be found.
|
static java.io.InputStream |
getResourceInputStream(java.lang.String resourceName)
Attempts to find a resource of the given name, and returns an input stream for reading that resource if it can be found.
|
public static java.lang.String getPackageResourceBaseName(java.lang.Class<? extends java.lang.Object> clazz, java.lang.String resourceTypeName)
clazz
- the class for which the corresponding properties resource name is to be returnedresourceTypeName
- indication of the type of resource, e.g. 'properties' or 'keystore'public static java.lang.String getResourceBaseName(java.lang.Class<? extends java.lang.Object> clazz, java.lang.String resourceTypeName)
clazz
- the class for which the corresponding properties resource name is to be returnedresourceTypeName
- indication of the type of resource, e.g. 'properties' or 'keystore'public static java.io.InputStream getResourceInputStream(java.lang.Class<?> clazz, java.lang.String resourceName) throws NotFoundException
clazz
- The class object representing the class of the object for which the resource is to be locatedresourceName
- The name of the resource to be searchedNotFoundException
- If no resource of the indicated name could be foundpublic static java.io.InputStream getResourceInputStream(java.lang.String resourceName) throws NotFoundException
resourceName
- The name of the resource to be searchedNotFoundException
- If no resource of the indicated name could be found