Package adams.core.io
Interface FileObject
-
- All Superinterfaces:
Comparable<FileObject>,Serializable
- All Known Implementing Classes:
LocalFileObject,SftpFileObject,SmbFileObject
public interface FileObject extends Serializable, Comparable<FileObject>
Interface for wrappers around files to avoid costly API calls by caching values also abstracting file representation.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FilegetActualFile()Returns the actual target (if possible) in case of a link.FilegetFile()Returns the wrapped file.DategetLastModified()Returns the date when the file was last modified.longgetLength()Returns the size of the file.StringgetName()Returns the file name.FileObjectgetParent()Returns the parent, if available.booleanisDirectory()Returns whether the file represents a directory.booleanisHidden()Returns whether the file is hidden.booleanisLink()Returns whether the file represents a link.booleanisLocal()Returns whether the file is a local file.StringtoString()Returns just the file's string representation.-
Methods inherited from interface java.lang.Comparable
compareTo
-
-
-
-
Method Detail
-
getParent
FileObject getParent()
Returns the parent, if available.- Returns:
- the parent or null if not available
-
getFile
File getFile()
Returns the wrapped file.- Returns:
- the file
-
getActualFile
File getActualFile()
Returns the actual target (if possible) in case of a link.- Returns:
- the actual file
-
getName
String getName()
Returns the file name.- Returns:
- the name
-
getLength
long getLength()
Returns the size of the file.- Returns:
- the size
-
isDirectory
boolean isDirectory()
Returns whether the file represents a directory.- Returns:
- true if directory
-
getLastModified
Date getLastModified()
Returns the date when the file was last modified.- Returns:
- date when last modified
-
isHidden
boolean isHidden()
Returns whether the file is hidden.- Returns:
- true if hidden
-
isLink
boolean isLink()
Returns whether the file represents a link.- Returns:
- true if link
-
isLocal
boolean isLocal()
Returns whether the file is a local file.- Returns:
- true if local
-
-