|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openbp.common.resource.ResourceMgr
public class ResourceMgr
The resource manager class provides a way of accessing resources bundled with the application.
| Field Summary | |
|---|---|
static int |
CLASSPATH_RESOURCE_PROVIDER_PRIO
Assign a low priority for the default classpath resource provider (100) |
static int |
ROOTDIR_RESOURCE_PROVIDER_PRIO
Assign a medium priority for the default root dir resource provider (50) |
static int |
USERHOMEDIR_RESOURCE_PROVIDER_PRIO
Assign a high priority for the user's HOME dir resource provider (25) |
| Constructor Summary | |
|---|---|
ResourceMgr()
Default constructor. |
|
ResourceMgr(org.springframework.core.io.ResourceLoader resourceLoader)
Value constructor. |
|
| Method Summary | |
|---|---|
org.springframework.core.io.Resource[] |
findResources(java.lang.String resourceLocation)
Finds resources according to the given resource location pattern, preferably in the class path. |
static ResourceMgr |
getDefaultInstance()
Gets the singleton instance of this class. |
org.springframework.core.io.Resource |
getResource(java.lang.String resourceLocation)
Gets the specified resource. |
org.springframework.core.io.ResourceLoader |
getResourceLoader()
Gets the resource loader. |
ResourceResolver |
getResourceResolver()
Gets the value of the resourceResolver property. |
java.net.URL |
getURL(java.lang.String resourceLocation)
Returns the URL of the provided resource. |
byte[] |
loadByteResource(org.springframework.core.io.Resource res)
Loads the specified resource as array of bytes. |
byte[] |
loadByteResource(java.lang.String resourceLocation)
Loads the specified resource as array of bytes. |
java.io.InputStream |
openResource(java.lang.String resourceLocation)
Opens an input stream to the specified resource. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int USERHOMEDIR_RESOURCE_PROVIDER_PRIO
public static final int ROOTDIR_RESOURCE_PROVIDER_PRIO
public static final int CLASSPATH_RESOURCE_PROVIDER_PRIO
| Constructor Detail |
|---|
public ResourceMgr()
public ResourceMgr(org.springframework.core.io.ResourceLoader resourceLoader)
resourceLoader - Resource loader| Method Detail |
|---|
public static ResourceMgr getDefaultInstance()
public org.springframework.core.io.Resource getResource(java.lang.String resourceLocation)
resourceLocation - Resource location; this can be a resource name that is expected to be resolved by the underlying resource loader
(e. g. "conf/MyResource.xml" that would be resolved to a component of a Jar file by a classpath-based loader)
or an explicit resource url specification (e. g. "classpath:conf/MyResource.xml"). For details
on this format, see the Spring reference guide.
ResourceMgrException - If no such resource could be found
public java.io.InputStream openResource(java.lang.String resourceLocation)
throws ResourceMgrException
resourceLocation - Resource location
ResourceMgrException - If the resource does not exist
ResourceMgrException - If no such resoure could be found
public byte[] loadByteResource(java.lang.String resourceLocation)
throws ResourceMgrException
resourceLocation - Resource location
ResourceMgrException - On read error or if the resource does not exist
public byte[] loadByteResource(org.springframework.core.io.Resource res)
throws ResourceMgrException
res - Resource
ResourceMgrException - On read error or if the resource does not exist
public org.springframework.core.io.Resource[] findResources(java.lang.String resourceLocation)
throws ResourceMgrException
resourceLocation - Resource location patternResourceMgrException - On I/O errorspublic java.net.URL getURL(java.lang.String resourceLocation)
resourceLocation - Resource location; this can be a resource name that is expected to be resolved by the underlying resource loader
(e. g. "conf/MyResource.xml" that would be resolved to a component of a Jar file by a classpath-based loader)
or an explicit resource url specification (e. g. "classpath:conf/MyResource.xml"). For details
on this format, see the Spring reference guide.
public org.springframework.core.io.ResourceLoader getResourceLoader()
public ResourceResolver getResourceResolver()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||