Class File

java.lang.Object
com.google.common.jimfs.File

public abstract class File extends Object
A file object, containing both the file's metadata and content.
Author:
Colin Decker
  • Method Details

    • id

      public int id()
      Returns the ID of this file.
    • size

      public long size()
      Returns the size, in bytes, of this file's content. Directories and symbolic links have a size of 0.
    • isDirectory

      public final boolean isDirectory()
      Returns whether or not this file is a directory.
    • isRegularFile

      public final boolean isRegularFile()
      Returns whether or not this file is a regular file.
    • isSymbolicLink

      public final boolean isSymbolicLink()
      Returns whether or not this file is a symbolic link.
    • links

      public final int links()
      Returns the current count of links to this file.
    • getCreationTime

      public final long getCreationTime()
      Gets the creation time of the file.
    • getLastAccessTime

      public final long getLastAccessTime()
      Gets the last access time of the file.
    • getLastModifiedTime

      public final long getLastModifiedTime()
      Gets the last modified time of the file.
    • getAttributeNames

      public final com.google.common.collect.ImmutableSet<String> getAttributeNames(String view)
      Returns the names of the attributes contained in the given attribute view in the file's attributes table.
    • getAttribute

      @Nullable public final Object getAttribute(String view, String attribute)
      Gets the value of the given attribute in the given view.
    • setAttribute

      public final void setAttribute(String view, String attribute, Object value)
      Sets the given attribute in the given view to the given value.
    • deleteAttribute

      public final void deleteAttribute(String view, String attribute)
      Deletes the given attribute from the given view.
    • toString

      public final String toString()
      Overrides:
      toString in class Object