public class FileInfo
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) java.lang.String |
baseDirectory
The base directory.
|
(package private) java.io.File |
file
The wrapped file.
|
Constructor and Description |
---|
FileInfo(java.io.File file)
Create a wrapped file.
|
FileInfo(java.io.File file,
java.io.File baseDirectory)
Create a wrapped file.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getFileName()
Get file name.
|
java.lang.String |
getFullFileName()
Get full file name.
|
boolean |
getIsDirectory()
True if file is a directory.
|
boolean |
getIsFile()
True if file is a normal file.
|
long |
getLastModified()
Get last modified time.
|
java.util.Date |
getLastModifiedDateTime()
Get last modified date/time.
|
long |
getLength()
Get file length.
|
java.io.File |
getParentFile()
Get parent file.
|
java.lang.String |
getParentPath()
Get parent file path.
|
java.lang.String |
getRelativeFileName()
Get full file name relative to base directory.
|
java.lang.String |
getRelativeParentPath()
Get parent directory path relative to base directory.
|
java.lang.String |
toString()
Return full file name as default string value.
|
java.io.File file
java.lang.String baseDirectory
public FileInfo(java.io.File file)
file
- The file to wrap.public FileInfo(java.io.File file, java.io.File baseDirectory)
file
- The file to wrap.baseDirectory
- The base directory.public java.lang.String getFileName()
public java.lang.String getFullFileName()
public java.lang.String getRelativeFileName()
public long getLength()
public long getLastModified()
public java.util.Date getLastModifiedDateTime()
public boolean getIsFile()
public boolean getIsDirectory()
public java.io.File getParentFile()
public java.lang.String getParentPath()
public java.lang.String getRelativeParentPath()
public java.lang.String toString()
toString
in class java.lang.Object