org.springframework.core.io
Class DefaultResourceLoader.ClassPathContextResource
java.lang.Object
org.springframework.core.io.AbstractResource
org.springframework.core.io.AbstractFileResolvingResource
org.springframework.core.io.ClassPathResource
org.springframework.core.io.DefaultResourceLoader.ClassPathContextResource
- All Implemented Interfaces:
- ContextResource, InputStreamSource, Resource
- Enclosing class:
- DefaultResourceLoader
private static class DefaultResourceLoader.ClassPathContextResource
- extends ClassPathResource
- implements ContextResource
ClassPathResource that explicitly expresses a context-relative path
through implementing the ContextResource interface.
Method Summary |
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'. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
DefaultResourceLoader.ClassPathContextResource
public DefaultResourceLoader.ClassPathContextResource(java.lang.String path,
java.lang.ClassLoader classLoader)
getPathWithinContext
public java.lang.String getPathWithinContext()
- Description copied from interface:
ContextResource
- Return the path within the enclosing 'context'.
This is typically path relative to a context-specific root directory,
e.g. a ServletContext root or a PortletContext root.
- Specified by:
getPathWithinContext
in interface ContextResource
createRelative
public Resource createRelative(java.lang.String relativePath)
- Description copied from class:
ClassPathResource
- This implementation creates a ClassPathResource, applying the given path
relative to the path of the underlying resource of this descriptor.
- Specified by:
createRelative
in interface Resource
- Overrides:
createRelative
in class ClassPathResource
- Parameters:
relativePath
- the relative path (relative to this resource)
- Returns:
- the resource handle for the relative resource
- See Also:
StringUtils.applyRelativePath(String, String)