类 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
- 所有已实现的接口:
ContextResource
,InputStreamSource
,Resource
protected static class DefaultResourceLoader.ClassPathContextResource extends ClassPathResource implements ContextResource
ClassPathResource that explicitly expresses a context-relative path through implementing the ContextResource interface.
构造器概要
构造器 构造器 说明 ClassPathContextResource(String path, ClassLoader classLoader)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 Resource
createRelative(String relativePath)
This implementation creates a ClassPathResource, applying the given path relative to the path of the underlying resource of this descriptor.String
getPathWithinContext()
Return the path within the enclosing 'context'.从类继承的方法 org.springframework.core.io.ClassPathResource
equals, exists, getClassLoader, getDescription, getFilename, getInputStream, getPath, getURL, hashCode, resolveURL
从类继承的方法 org.springframework.core.io.AbstractFileResolvingResource
contentLength, customizeConnection, customizeConnection, getFile, getFile, getFileForLastModifiedCheck, isReadable, lastModified
从类继承的方法 org.springframework.core.io.AbstractResource
getURI, isOpen, toString
从接口继承的方法 org.springframework.core.io.InputStreamSource
getInputStream
从接口继承的方法 org.springframework.core.io.Resource
contentLength, exists, getDescription, getFile, getFilename, getURI, getURL, isOpen, isReadable, lastModified
构造器详细资料
ClassPathContextResource
public ClassPathContextResource(String path, ClassLoader classLoader)
方法详细资料
getPathWithinContext
public String getPathWithinContext()
从接口复制的说明: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.
- 指定者:
getPathWithinContext
在接口中ContextResource
createRelative
public Resource createRelative(String relativePath)
从类复制的说明:ClassPathResource
This implementation creates a ClassPathResource, applying the given path relative to the path of the underlying resource of this descriptor.- 指定者:
createRelative
在接口中Resource
- 覆盖:
createRelative
在类中ClassPathResource
- 参数:
relativePath
- the relative path (relative to this resource)- 返回:
- the resource handle for the relative resource
- 另请参阅:
StringUtils.applyRelativePath(String, String)