private static class ClassRelativeResourceLoader.ClassRelativeContextResource extends ClassPathResource implements ContextResource
Modifier and Type | Field and Description |
---|---|
private java.lang.Class<?> |
clazz |
Constructor and Description |
---|
ClassRelativeContextResource(java.lang.String path,
java.lang.Class<?> clazz) |
Modifier and Type | Method and Description |
---|---|
Resource |
createRelative(java.lang.String relativePath)
This implementation creates a ClassPathResource, applying the given path
relative to the path of the underlying resource of this descriptor.
|
java.lang.String |
getPathWithinContext()
Return the path within the enclosing 'context'.
|
equals, exists, getClassLoader, getDescription, getFilename, getInputStream, getPath, getURL, hashCode, resolveURL
contentLength, customizeConnection, customizeConnection, getFile, getFile, getFileForLastModifiedCheck, isReadable, lastModified
getURI, isOpen, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
contentLength, exists, getDescription, getFile, getFilename, getURI, getURL, isOpen, isReadable, lastModified
getInputStream
public ClassRelativeContextResource(java.lang.String path, java.lang.Class<?> clazz)
public java.lang.String getPathWithinContext()
ContextResource
This is typically path relative to a context-specific root directory, e.g. a ServletContext root or a PortletContext root.
getPathWithinContext
in interface ContextResource
public Resource createRelative(java.lang.String relativePath)
ClassPathResource
createRelative
in interface Resource
createRelative
in class ClassPathResource
relativePath
- the relative path (relative to this resource)StringUtils.applyRelativePath(String, String)