org.springframework.core.io

## 类 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
  封闭类:
    DefaultResourceLoader

      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, isFile, isFile, isReadable, lastModified, readableChannel`

    - ### 从类继承的方法 org.springframework.core.io.AbstractResource

      `getURI, isOpen, toString`

    - ### 从类继承的方法 java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### 从接口继承的方法 org.springframework.core.io.Resource

      `contentLength, exists, getDescription, getFile, getFilename, getURI, getURL, isFile, isOpen, isReadable, lastModified, readableChannel`

    - ### 从接口继承的方法 org.springframework.core.io.InputStreamSource

      `getInputStream`

- - ### 构造器详细资料

    - #### ClassPathContextResource

          public ClassPathContextResource(String path,
                                          @Nullable
                                          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)`