public class

ZipFailSafeReader

extends Object
implements AutoCloseable
java.lang.Object
   ↳ com.pnfsoftware.jeb.util.encoding.zip.fsr.ZipFailSafeReader

Class Overview

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:

  • limited to 2Gb archives at most
  • zip64 is not supported
  • uncommon flags are not supported
  • non-standard attributes are disregarded
  • the only compression scheme supported is DEFLATE

Summary

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)
ZipFailSafeReader(SeekableByteChannel channel, boolean treatUnsupportedCompressionAsDeflate, boolean ignoreEncryption, boolean recoveryMode)
Public Methods
void close()
List<ZipEntry> getEntries()
ZipEntry getEntry(String filename)
int getNumberOfEntries()
int getOffsetAppendedData()
int getOffsetFirstEntry()
boolean hasAppendedData()
boolean hasEntry(String filename)
boolean hasPrependedData()
boolean isClosed()
boolean isTruncated()
ZipData readData(String filename)
ZipData readData(ZipEntry e)
String toString()
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.lang.AutoCloseable

Public Constructors

public ZipFailSafeReader (File file)

Construct with all optional settings set to false.

Parameters
file input zip
Throws
IOException

public ZipFailSafeReader (SeekableByteChannel channel)

Construct with all optional settings set to false.

Parameters
channel input zip
Throws
IOException

public ZipFailSafeReader (File file, boolean treatUnsupportedCompressionAsDeflate, boolean ignoreEncryption, boolean recoveryMode)

Parameters
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
Throws
IOException

public ZipFailSafeReader (SeekableByteChannel channel, boolean treatUnsupportedCompressionAsDeflate, boolean ignoreEncryption, boolean recoveryMode)

Parameters
channel input
recoveryMode optional; if true, the reader will attempt to recover zip entries of truncated files, including those with incomplete Central Directory
Throws
IOException

Public Methods

public void close ()

Throws
IOException

public List<ZipEntry> getEntries ()

public ZipEntry getEntry (String filename)

public int getNumberOfEntries ()

public int getOffsetAppendedData ()

public int getOffsetFirstEntry ()

public boolean hasAppendedData ()

public boolean hasEntry (String filename)

public boolean hasPrependedData ()

public boolean isClosed ()

public boolean isTruncated ()

public ZipData readData (String filename)

Throws
IOException

public ZipData readData (ZipEntry e)

Throws
IOException

public String toString ()