Class FSFile
java.lang.Object
com.blackrook.fs.FSFile
- All Implemented Interfaces:
Comparable<FSFile>
- Direct Known Subclasses:
ClasspathArchive.ClasspathFile, FolderArchive.FolderFile
This describes metadata of a file within a FileSystem.
- Author:
- Matthew Tropiano
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbooleanChecks if this file equals another file.booleanabstract longgetDate()abstract InputStreamReturns an InputStream of a file within this wrapped file so that it may be read via a stream.abstract StringgetName()abstract StringgetPath()abstract longlength()toString()
-
Constructor Details
-
FSFile
public FSFile()
-
-
Method Details
-
toString
-
equals
-
equals
Checks if this file equals another file. Compares using path.- Parameters:
file- the other file.- Returns:
- true if equal, false if not.
-
compareTo
- Specified by:
compareToin interfaceComparable<FSFile>
-
getName
- Returns:
- the name of this file in the file system.
-
getPath
- Returns:
- the path of this file from the root of the system.
-
length
public abstract long length()- Returns:
- the length of this file in bytes.
-
getDate
public abstract long getDate()- Returns:
- the date that this file was created/modified.
-
getInputStream
Returns an InputStream of a file within this wrapped file so that it may be read via a stream.- Returns:
- an InputStream that can read the file, or null if the path refers to a location that is not inside this file.
- Throws:
IOException- if acquiring the stream throws an exception.
-