java.lang.Object | |
↳ | com.pnfsoftware.jeb.util.encoding.zip.fsr.ZipFailSafeReader |
PNF Software's Zip Fail Safe Reader (PZFSR). This parser attempts to handle corner-cases that fail Oracle's and Apache Common's parsers.
Limitations:
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ZipFailSafeReader(File file)
Construct with all optional settings set to false.
| |||||||||||
ZipFailSafeReader(SeekableByteChannel channel)
Construct with all optional settings set to false.
| |||||||||||
ZipFailSafeReader(File file, boolean treatUnsupportedCompressionAsDeflate, boolean ignoreEncryption, boolean recoveryMode, boolean doNotParseEntries)
Construct a zip parser.
| |||||||||||
ZipFailSafeReader(SeekableByteChannel channel, boolean treatUnsupportedCompressionAsDeflate, boolean ignoreEncryption, boolean recoveryMode, boolean doNotParseEntries)
Construct a zip parser.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void | close() | ||||||||||
Iterable<ZipEntry> |
enumerateEntries()
Get the iterable to parse and enumerate over the zip entries.
| ||||||||||
List<ZipEntry> |
getEntries()
Retrieve a read-only list of the current entries.
| ||||||||||
ZipEntry |
getEntry(String filename)
Retrieve an entry by name.
| ||||||||||
int | getNumberOfEntries() | ||||||||||
int | getOffsetAppendedData() | ||||||||||
int | getOffsetFirstEntry() | ||||||||||
boolean | hasAppendedData() | ||||||||||
boolean |
hasEntry(String filename)
Determine whether an entry exists.
| ||||||||||
boolean | hasPrependedData() | ||||||||||
boolean | isClosed() | ||||||||||
boolean | isTruncated() | ||||||||||
ZipData |
readData(String filename)
Read an entry's data and provide the decompressed bytes.
| ||||||||||
ZipData |
readData(ZipEntry e)
Read an entry's data and provide the decompressed bytes.
| ||||||||||
String | toString() |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
java.lang.AutoCloseable
|
Construct with all optional settings set to false.
file | input zip |
---|
IOException |
---|
Construct with all optional settings set to false.
channel | input zip |
---|
IOException |
---|
Construct a zip parser.
file | input zip |
---|---|
treatUnsupportedCompressionAsDeflate | optional |
ignoreEncryption | optional |
recoveryMode | optional; if true, the reader will attempt to recover zip entries of truncated files, including those with incomplete Central Directory |
doNotParseEntries | optional; if true, the zip entries will not be pre-emptively parsed,
and it will be up to the user to trigger parsing through enumeration, via
enumerateEntries() (this will result in faster opening of large archives) |
IOException |
---|
Construct a zip parser.
channel | input |
---|---|
recoveryMode | optional; if true, the reader will attempt to recover zip entries of truncated files, including those with incomplete Central Directory |
doNotParseEntries | optional; if true, the zip entries will not be pre-emptively parsed,
and it will be up to the user to trigger parsing through enumeration, via
enumerateEntries() (this will result in faster opening of large archives) |
IOException |
---|
IOException |
---|
Get the iterable to parse and enumerate over the zip entries. This method should be called
once, and once only, if the object was constructed with doNotParseEntries=true
. Any
IOException raised will be wrapped in a RuntimeException.
Retrieve a read-only list of the current entries.
This method may be called even if not all entries were enumerated (incomplete parsing). if so, it will return an incomplete list.
Retrieve an entry by name.
This method may be called even if not all entries were enumerated (incomplete parsing). It will fail if the entry has not been parsed yet.
Determine whether an entry exists. parsed yet.
This method may be called even if not all entries were enumerated (incomplete parsing). It will fail if the entry has not been parsed yet.
Read an entry's data and provide the decompressed bytes.
This method may be called even if not all entries were enumerated (incomplete parsing). It will fail if the entry has not been parsed yet.@return
IOException |
---|
Read an entry's data and provide the decompressed bytes.
This method may be called even if not all entries were enumerated (incomplete parsing). It will fail if the entry has not been parsed yet.@return
IOException |
---|