|
TrueZIP 6.8.3 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface ArchiveEntry
A simple interface for entries in an archive. Drivers need to implement this interface in order to allow TrueZIP to read and write entries for the supported archive types.
Implementations do not need to be thread safe:
Multithreading is addressed in the package de.schlichtherle.io.
TrueZIP 6 has the following requirements for archive entry names:
SEPARATOR).
""), a dot
("."), or a dot-dot ("..")
is not permissible as a directory or file name.
"foo/bar" denotes a valid entry
name for a file, but "./abc/../foo/./def/./../bar/."
would not, although both refer to the same entry.
As another example, "dir/" denotes a valid entry
name for a directory, but "dir" would not.
If an archive driver is to be written for an archive type which does not support these requirements, an adapter for the entry name must be implemented.
For example, the ZIP and TAR file formats conform to all but the second
requirement.
So the driver implementations for the archive types use
Paths.normalize(String, char) to remove
any redundant elements from the path.
It's hoped that these requirements can be relaxed, but this would imply some minor changes in the service provider interface for archive drivers, so it's not going to happen in this major version number.
A utility
method to remove empty and dot and dot-dot elements from an archive
entry name| Field Summary | |
|---|---|
static String |
SEPARATOR
The entry name separator as a string. |
static char |
SEPARATOR_CHAR
The entry name separator as a character. |
static byte |
UNKNOWN
The unknown value for numeric properties. |
| Method Summary | |
|---|---|
Icon |
getClosedIcon()
Returns the icon that FileSystemView
and FileTreeCellRenderer should
display for this entry if it is closed/collapsed in the view. |
ArchiveEntryMetaData |
getMetaData()
Returns the meta data for this archive entry. |
String |
getName()
Returns the archive entry name. |
Icon |
getOpenIcon()
Returns the icon that FileTreeCellRenderer
should display for this entry if it is open/expanded in the view. |
long |
getSize()
Returns the (uncompressed) size of the archive entry in bytes, or UNKNOWN if not specified. |
long |
getTime()
Returns the last modification time of this archive entry since the epoch, or UNKNOWN if not specified. |
boolean |
isDirectory()
Returns true if and only if this entry represents a
directory. |
void |
setMetaData(ArchiveEntryMetaData metaData)
Sets the meta data for this archive entry. |
void |
setTime(long time)
Sets the last modification time of this archive entry. |
| Field Detail |
|---|
static final String SEPARATOR
SEPARATOR_CHAR,
Constant Field Valuesstatic final char SEPARATOR_CHAR
SEPARATOR,
Constant Field Valuesstatic final byte UNKNOWN
| Method Detail |
|---|
String getName()
boolean isDirectory()
true if and only if this entry represents a
directory.
long getSize()
UNKNOWN if not specified.
This method is not meaningful for directory entries.
long getTime()
UNKNOWN if not specified.
setTime(long)void setTime(long time)
time - The last modification time of this archive entry in
milliseconds since the epoch.getTime()Icon getOpenIcon()
FileTreeCellRenderer
should display for this entry if it is open/expanded in the view.
If null is returned, a default icon will be used,
depending on the type of this entry and its state in the view.
Icon getClosedIcon()
FileSystemView
and FileTreeCellRenderer should
display for this entry if it is closed/collapsed in the view.
If null is returned, a default icon will be used,
depending on the type of this entry and its state in the view.
ArchiveEntryMetaData getMetaData()
null.
void setMetaData(ArchiveEntryMetaData metaData)
metaData - The meta data - may not be null.
|
TrueZIP 6.8.3 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||