public class File
extends java.lang.Object
File is identified by its getPath().
Path is an abstract string, it can be used to codify a hierarchy, though VirtualFileSystem doesn't
contain methods to enumerate files by a path prefix.
In addition, File can be identified by a file descriptor which an internal VirtualFileSystem
long unique id. Identifying by file descriptor allows to
rename a file.
File has its created and last modified time.
| Modifier and Type | Method and Description |
|---|---|
long |
getCreated()
Returns the time when the
File was created. |
long |
getDescriptor() |
long |
getLastModified()
Returns the time when the
File was modified last time or explicitly touched. |
@NotNull java.lang.String |
getPath()
Returns the path which the
File is identified by. |
java.lang.String |
toString() |
@NotNull public @NotNull java.lang.String getPath()
File is identified by. Path is an abstract string, it can be used to codify
a hierarchy, though VirtualFileSystem doesn't contain methods to enumerate files by a path prefix.Filepublic long getDescriptor()
File's internal unique idpublic long getCreated()
File was created. This value never changes.File was createdVirtualFileSystem.createFile(Transaction, String),
VirtualFileSystem.createFile(Transaction, long, String),
VirtualFileSystem.openFile(Transaction, String, boolean)public long getLastModified()
File was modified last time or explicitly touched.
VirtualFileSystem's methods that open OutputStream by file descriptor, not
File instance, return the stream which doesn't update last modified time.
The returned value is actual to the moment of the File instance creation,
open new File instance to get
consistent value of last modified time.
File was modified last time or explicitly touchedVirtualFileSystem.touchFile(Transaction, File)public java.lang.String toString()
toString in class java.lang.Object