类 FileSystemResource

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

public class FileSystemResource extends AbstractResource implements WritableResource
Copy from https://github.com/spring-projects/spring-framework.git, with less modifications Resource implementation for java.io.File and java.nio.file.Path handles with a file system target. Supports resolution as a File and also as a URL. Implements the extended WritableResource interface.

Note: As of Spring Framework 5.0, this Resource implementation uses NIO.2 API for read/write interactions. As of 5.1, it may be constructed with a Path handle in which case it will perform all file system interactions via NIO.2, only resorting to File on getFile().

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

    构造器
    构造器
    说明
    Create a new FileSystemResource from a File handle.
    Create a new FileSystemResource from a file path.
    Create a new FileSystemResource from a FileSystem handle, locating the specified path.
    Create a new FileSystemResource from a Path handle, performing all file system interactions via NIO.2 instead of File.
  • 方法概要

    修饰符和类型
    方法
    说明
    long
    This implementation returns the underlying File/Path length.
    createRelative(String relativePath)
    This implementation creates a FileSystemResource, 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 File references.
    boolean
    This implementation returns whether the underlying file exists.
    This implementation returns a description that includes the absolute path of the file.
    This implementation returns the underlying File reference.
    This implementation returns the name of the file.
    This implementation opens a NIO file stream for the underlying file.
    This implementation opens a FileOutputStream 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 File 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/Path last-modified time.
    This implementation opens a FileChannel for the underlying file.
    This implementation opens a FileChannel 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