Package com.blackrook.fs
Class FSFile
- java.lang.Object
-
- com.blackrook.fs.FSFile
-
- All Implemented Interfaces:
Comparable<FSFile>
- Direct Known Subclasses:
ClasspathArchive.ClasspathFile
,FolderArchive.FolderFile
public abstract class FSFile extends Object implements Comparable<FSFile>
This describes metadata of a file within a FileSystem.- Author:
- Matthew Tropiano
-
-
Constructor Summary
Constructors Constructor Description FSFile()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description int
compareTo(FSFile file)
boolean
equals(FSFile file)
Checks if this file equals another file.boolean
equals(Object obj)
abstract long
getDate()
abstract InputStream
getInputStream()
Returns an InputStream of a file within this wrapped file so that it may be read via a stream.abstract String
getName()
abstract String
getPath()
abstract long
length()
String
toString()
-
-
-
Method Detail
-
equals
public boolean equals(FSFile file)
Checks if this file equals another file. Compares using path.- Parameters:
file
- the other file.- Returns:
- true if equal, false if not.
-
compareTo
public int compareTo(FSFile file)
- Specified by:
compareTo
in interfaceComparable<FSFile>
-
getName
public abstract String getName()
- Returns:
- the name of this file in the file system.
-
getPath
public abstract String 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
public abstract InputStream getInputStream() throws IOException
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.
-
-