org.openbp.common.resource
Class ClasspathResourceProvider

java.lang.Object
  extended by org.openbp.common.resource.ResourceProvider
      extended by org.openbp.common.resource.ClasspathResourceProvider

public class ClasspathResourceProvider
extends ResourceProvider

Loads resources from the classpath. In order to load resources from within an EAR file under SUN application server, an additional classpath statement needs to be present in the EAR's MANIFEST file. org.apache.maven.plugins maven-ear-plugin config true ...

Author:
Heiko Erhardt

Field Summary
 
Fields inherited from class org.openbp.common.resource.ResourceProvider
PROTOCOL_PREFIX_SEPARATOR, resourceLoader
 
Constructor Summary
ClasspathResourceProvider(int priority, org.springframework.core.io.ResourceLoader resourceLoader)
           
 
Method Summary
 java.lang.String getPrefix()
          Protocol prefix of this provider
 org.springframework.core.io.Resource getResource(java.lang.String resourceLocation)
          Gets a resource.
 java.lang.String toString()
           
 
Methods inherited from class org.openbp.common.resource.ResourceProvider
applyPrefix, getPriority, getResourceLoader, hasPrefix, setPriority, setResourceLoader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClasspathResourceProvider

public ClasspathResourceProvider(int priority,
                                 org.springframework.core.io.ResourceLoader resourceLoader)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getResource

public org.springframework.core.io.Resource getResource(java.lang.String resourceLocation)
                                                 throws ResourceMgrException
Description copied from class: ResourceProvider
Gets a resource.

Specified by:
getResource in class ResourceProvider
Parameters:
resourceLocation - Resource location
Returns:
The resource
Throws:
ResourceMgrException - If the provider is unable to find the specified resource

getPrefix

public java.lang.String getPrefix()
Description copied from class: ResourceProvider
Protocol prefix of this provider

Overrides:
getPrefix in class ResourceProvider
Returns:
E.g. "file:", "classpath:", "http:"; default is ""


Copyright © 2011. All Rights Reserved.