|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.aeonscope.io.FileInfo
public class FileInfo
The default file information implementation.
| Field Summary | |
|---|---|
static String |
ATTR_DATE
The element attribute: date. |
static String |
ATTR_LABEL
The element attribute: label. |
static String |
ATTR_MD5SUM
The element attribute: checksum. |
static String |
ATTR_NAME
The element attribute: name. |
static String |
ATTR_SIZE
The element attribute: size. |
static String |
ATTR_TIME
The element attribute: time. |
static String |
ATTR_TYPE
The element attribute: type. |
static String |
DEFAULT_DATE_FORMAT
The default date format. |
static String |
DEFAULT_TIME_FORMAT
The default time format. |
static String |
QMARK
The default value, rather being null, for file information that is not defined, does not exist, or is simply unknown. |
static String |
TYPE_DIR
The directory type. |
static String |
TYPE_FILE
The file type. |
static String |
TYPE_UNKNOWN
The directory type. |
| Constructor Summary | |
|---|---|
FileInfo()
Constructs a null file where the type is "?". |
|
FileInfo(File file)
Constructs a new file based upon the given file setting the file type equal to the file extension (if found). |
|
FileInfo(String filePath)
Constructs a new file based upon the given file path setting the file type equal to the file extension (if found). |
|
| Method Summary | |
|---|---|
org.jdom.Element |
asElement()
Renders the file name, label, type, size, date, and time attribute information as an XML element. |
org.jdom.Element |
asElementWithMD5Sum()
This method does everything that the asElement() does except adds MD5 checksum attribute information to the element. |
String |
getBasename()
Answers the base name of the file (i.e. |
String |
getElementName()
The element name based on whether the file is a file, directory, or unknown. |
String |
getExtension()
Answers the file extension.Example: "example.txt" yields "txt". |
File |
getFile()
Answers the associated file. |
String |
getLabel()
The file label which is computed by capitalizing the first letter of the file base name. |
String |
getLastModifiedDate()
Answers the last modified file date using the user defined or default format. |
String |
getLastModifiedTime()
Answers the last modified file time using the user defined or default format. |
String |
getMD5Sum()
Answers the MD5, 32-character hex checksum of a file only as calculation on a directory is excluded. |
String |
getName()
Answers the name of the file. |
String |
getParent()
Answers the parent path of the file.Example: "/path/to/file/example.txt" yields "/path/to/file". |
String |
getPath()
Answers the path to the file.Example: "/file/path/example.txt" yields "/file/path/example.txt". |
String |
getSize()
Answer the size of the file in human readable format or, in the case of directory, the size is a summation of all files and sub-directories.Examples: 3 bytes, 12 KB, 10 MB, etc. |
String |
getType()
The type of file. |
void |
setDateFormat(String format)
Sets the format to use for displaying the date.Example: yyyy-MM-dd |
void |
setFile(File file)
Sets the file based upon the given file. |
void |
setFile(String path)
Sets the file based on the given file path. |
void |
setTimeFormat(String format)
Sets the format to use for displaying the time.Example: HH:mm:ss |
String |
toString()
The file name + size + checksum + date + time as a string. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String TYPE_FILE
public static final String TYPE_DIR
public static final String TYPE_UNKNOWN
public static final String ATTR_NAME
public static final String ATTR_LABEL
public static final String ATTR_TYPE
public static final String ATTR_SIZE
public static final String ATTR_MD5SUM
public static final String ATTR_DATE
public static final String ATTR_TIME
public static final String QMARK
public static final String DEFAULT_DATE_FORMAT
public static final String DEFAULT_TIME_FORMAT
| Constructor Detail |
|---|
public FileInfo()
public FileInfo(String filePath)
filePath - The path to the file.public FileInfo(File file)
file - The file.| Method Detail |
|---|
public File getFile()
IFileInfo
getFile in interface IFileInfoIFileInfo.getFile()public String getName()
IFileInfo
getName in interface IFileInfoIFileInfo.getName()public String getElementName()
IFileInfo
getElementName in interface IFileInfoIFileInfo.getElementName()public String getLabel()
IFileInfo
getLabel in interface IFileInfoIFileInfo.getLabel()public String getType()
IFileInfo
getType in interface IFileInfoIFileInfo.getType()public String getBasename()
IFileInfo
getBasename in interface IFileInfoIFileInfo.getBasename()public String getExtension()
IFileInfo
getExtension in interface IFileInfoIFileInfo.getExtension()public String getParent()
IFileInfo
getParent in interface IFileInfoIFileInfo.getParent()public String getPath()
IFileInfo
getPath in interface IFileInfoIFileInfo.getPath()public String getSize()
IFileInfo
getSize in interface IFileInfoIFileInfo.getSize()public String getMD5Sum()
IFileInfo
getMD5Sum in interface IFileInfoIFileInfo.getMD5Sum()public String getLastModifiedDate()
IFileInfo
getLastModifiedDate in interface IFileInfoIFileInfo.getLastModifiedDate()public String getLastModifiedTime()
IFileInfo
getLastModifiedTime in interface IFileInfoIFileInfo.getLastModifiedTime()public void setDateFormat(String format)
IFileInfo
setDateFormat in interface IFileInfoformat - The date format.IFileInfo.setDateFormat(java.lang.String)public void setTimeFormat(String format)
IFileInfo
setTimeFormat in interface IFileInfoformat - The time format.IFileInfo.setTimeFormat(java.lang.String)public void setFile(String path)
IFileInfo
setFile in interface IFileInfopath - The file path to set.IFileInfo.setFile(java.lang.String)public void setFile(File file)
IFileInfo
setFile in interface IFileInfofile - The file.IFileInfo.setFile(java.io.File)public String toString()
toString in class ObjectObject.toString()public org.jdom.Element asElement()
asElement in interface IJDOMProducerIJDOMProducer.asElement()public org.jdom.Element asElementWithMD5Sum()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||