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 void
deleteAttribute
(String view, String attribute) Deletes the given attribute from the given view.final Object
getAttribute
(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 long
Gets the creation time of the file.final long
Gets the last access time of the file.final long
Gets the last modified time of the file.int
id()
Returns the ID of this file.final boolean
Returns whether or not this file is a directory.final boolean
Returns whether or not this file is a regular file.final boolean
Returns whether or not this file is a symbolic link.final int
links()
Returns the current count of links to this file.final void
setAttribute
(String view, String attribute, Object value) Sets the given attribute in the given view to the given value.long
size()
Returns the size, in bytes, of this file's content.final String
toString()
-
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
-