Package com.google.common.jimfs
Class File
- java.lang.Object
-
- com.google.common.jimfs.File
-
public abstract class File extends java.lang.ObjectA file object, containing both the file's metadata and content.- Author:
- Colin Decker
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeleteAttribute(java.lang.String view, java.lang.String attribute)Deletes the given attribute from the given view.java.lang.ObjectgetAttribute(java.lang.String view, java.lang.String attribute)Gets the value of the given attribute in the given view.com.google.common.collect.ImmutableSet<java.lang.String>getAttributeNames(java.lang.String view)Returns the names of the attributes contained in the given attribute view in the file's attributes table.longgetCreationTime()Gets the creation time of the file.longgetLastAccessTime()Gets the last access time of the file.longgetLastModifiedTime()Gets the last modified time of the file.intid()Returns the ID of this file.booleanisDirectory()Returns whether or not this file is a directory.booleanisRegularFile()Returns whether or not this file is a regular file.booleanisSymbolicLink()Returns whether or not this file is a symbolic link.intlinks()Returns the current count of links to this file.voidsetAttribute(java.lang.String view, java.lang.String attribute, java.lang.Object value)Sets the given attribute in the given view to the given value.longsize()Returns the size, in bytes, of this file's content.java.lang.StringtoString()
-
-
-
Method Detail
-
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<java.lang.String> getAttributeNames(java.lang.String view)
Returns the names of the attributes contained in the given attribute view in the file's attributes table.
-
getAttribute
@Nullable public final java.lang.Object getAttribute(java.lang.String view, java.lang.String attribute)Gets the value of the given attribute in the given view.
-
setAttribute
public final void setAttribute(java.lang.String view, java.lang.String attribute, java.lang.Object value)Sets the given attribute in the given view to the given value.
-
deleteAttribute
public final void deleteAttribute(java.lang.String view, java.lang.String attribute)Deletes the given attribute from the given view.
-
toString
public final java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-