类 PathResource

    • 构造器概要

      构造器 
      构造器说明
      PathResource​(String path)
      Create a new PathResource from a Path handle.
      PathResource​(URI uri)
      Create a new PathResource from a Path handle.
      PathResource​(Path path)
      Create a new PathResource from a Path handle.
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型方法说明
      longcontentLength()
      This implementation returns the underlying file's length.
      ResourcecreateRelative​(String relativePath)
      This implementation creates a PathResource, applying the given path relative to the path of the underlying file of this resource descriptor.
      booleanequals​(Object obj)
      This implementation compares the underlying Path references.
      booleanexists()
      This implementation returns whether the underlying file exists.
      StringgetDescription()
      Return a description for this resource, to be used for error output when working with the resource.
      FilegetFile()
      This implementation returns the underlying File reference.
      StringgetFilename()
      This implementation returns the name of the file.
      InputStreamgetInputStream()
      This implementation opens a InputStream for the underlying file.
      OutputStreamgetOutputStream()
      This implementation opens a OutputStream for the underlying file.
      StringgetPath()
      Return the file path for this resource.
      URIgetURI()
      This implementation returns a URI for the underlying file.
      URLgetURL()
      This implementation returns a URL for the underlying file.
      inthashCode()
      This implementation returns the hash code of the underlying Path reference.
      booleanisReadable()
      This implementation checks whether the underlying file is marked as readable (and corresponds to an actual file with content, not to a directory).
      booleanisWritable()
      This implementation checks whether the underlying file is marked as writable (and corresponds to an actual file with content, not to a directory).
      longlastModified()
      This implementation returns the underlying File's timestamp.