类 PathResource

java.lang.Object
com.alibaba.nacos.common.packagescan.resource.AbstractResource
com.alibaba.nacos.common.packagescan.resource.PathResource
所有已实现的接口:
InputStreamSource, Resource, WritableResource

public class PathResource extends AbstractResource implements WritableResource
Copy from https://github.com/spring-projects/spring-framework.git, with less modifications Resource implementation for Path handles, performing all operations and transformations via the Path API. Supports resolution as a File and also as a URL. Implements the extended WritableResource interface.

Note: As of 5.1, Path support is also available in FileSystemResource, applying Spring's standard String-based path transformations but performing all operations via the Files API. This PathResource is effectively a pure java.nio.path.Path based alternative with different createRelative behavior.

从以下版本开始:
4.0
作者:
Philippe Marschall, Juergen Hoeller
另请参阅:
  • 构造器概要

    构造器
    构造器
    说明
    Create a new PathResource from a Path handle.
    Create a new PathResource from a Path handle.
    Create a new PathResource from a Path handle.
  • 方法概要

    修饰符和类型
    方法
    说明
    long
    This implementation returns the underlying file's length.
    createRelative(String relativePath)
    This implementation creates a PathResource, applying the given path relative to the path of the underlying file of this resource descriptor.
    boolean
    equals(Object other)
    This implementation compares the underlying Path references.
    boolean
    This implementation returns whether the underlying file exists.
    Return a description for this resource, to be used for error output when working with the resource.
    This implementation returns the underlying File reference.
    This implementation returns the name of the file.
    This implementation opens a InputStream for the underlying file.
    This implementation opens a OutputStream for the underlying file.
    final String
    Return the file path for this resource.
    This implementation returns a URI for the underlying file.
    This implementation returns a URL for the underlying file.
    int
    This implementation returns the hash code of the underlying Path reference.
    boolean
    This implementation always indicates a file.
    boolean
    This implementation checks whether the underlying file is marked as readable (and corresponds to an actual file with content, not to a directory).
    boolean
    This implementation checks whether the underlying file is marked as writable (and corresponds to an actual file with content, not to a directory).
    long
    This implementation returns the underlying File's timestamp.
    This implementation opens a Channel for the underlying file.
    This implementation opens a Channel for the underlying file.

    从类继承的方法 com.alibaba.nacos.common.packagescan.resource.AbstractResource

    getFileForLastModifiedCheck, isOpen, toString

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

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

    从接口继承的方法 com.alibaba.nacos.common.packagescan.resource.Resource

    isOpen