Package com.google.common.jimfs
Class File
java.lang.Object
com.google.common.jimfs.File
A file object, containing both the file's metadata and content.
- Author:
- Colin Decker
-
Method Summary
Modifier and TypeMethodDescriptionfinal voiddeleteAttribute(String view, String attribute) Deletes the given attribute from the given view.final ObjectgetAttribute(String view, String attribute) Gets the value of the given attribute in the given view.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.final longGets the creation time of the file.final longGets the last access time of the file.final longGets the last modified time of the file.intid()Returns the ID of this file.final booleanReturns whether or not this file is a directory.final booleanReturns whether or not this file is a regular file.final booleanReturns whether or not this file is a symbolic link.final intlinks()Returns the current count of links to this file.final voidsetAttribute(String view, String attribute, 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.final StringtoString()
-
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
Returns the names of the attributes contained in the given attribute view in the file's attributes table. -
getAttribute
Gets the value of the given attribute in the given view. -
setAttribute
Sets the given attribute in the given view to the given value. -
deleteAttribute
Deletes the given attribute from the given view. -
toString
-