org.springframework.core.io

## 接口 ContextResource

- 所有超级接口:
    InputStreamSource, Resource
  所有已知实现类:
    DefaultResourceLoader.ClassPathContextResource

      public interface ContextResource
      extends Resource

  Extended interface for a resource that is loaded from an enclosing 'context', e.g. from a `ServletContext` but also from plain classpath paths or relative file system paths (specified without an explicit prefix, hence applying relative to the local `ResourceLoader`'s context).
  从以下版本开始:
    2.5
  作者:
    Juergen Hoeller
  另请参阅:
    `org.springframework.web.context.support.ServletContextResource`

- - ### 方法概要

    所有方法 实例方法 抽象方法
    限定符和类型 | 方法和说明
    --- | ---
    `String` | `getPathWithinContext()` Return the path within the enclosing 'context'.

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

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

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

      `getInputStream`

- - ### 方法详细资料

    - #### getPathWithinContext

          String getPathWithinContext()

      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.