public interface ArchiveEntry
The life of an ArchiveEntry
is dependent on the status of the ArchiveStream
it came from. Once
retrieved via ArchiveStream.getNextEntry()
, the entry can be used as long as the ArchiveStream
remains on this entry, i.e. getNextEntry()
was not called, and the stream was not since closed.
Modifier and Type | Field and Description |
---|---|
static long |
UNKNOWN_SIZE
Special value indicating that the size is unknown
|
Modifier and Type | Method and Description |
---|---|
java.io.File |
extract(java.io.File destination)
Extracts the entry to the given destination directory.
|
java.util.Date |
getLastModifiedDate()
Returns the last modified date of the entry.
|
java.lang.String |
getName()
The name of the entry in the archive.
|
long |
getSize()
The (uncompressed) size of the entry.
|
boolean |
isDirectory()
Checks whether the given entry is a directory.
|
static final long UNKNOWN_SIZE
java.lang.String getName()
long getSize()
java.util.Date getLastModifiedDate()
boolean isDirectory()
java.io.File extract(java.io.File destination) throws java.io.IOException, java.lang.IllegalStateException, java.lang.IllegalArgumentException
The destination is expected to be a writable directory.
destination
- the directory to extract the value tojava.io.IOException
- propagated I/O errors by java.io
java.lang.IllegalStateException
- if the entry is out of sync with the streamjava.lang.IllegalArgumentException
- if the destination is not a directory, or a directory can not be created at the
given location