Package org.apache.poi.openxml4j.util
Class ZipFileZipEntrySource
java.lang.Object
org.apache.poi.openxml4j.util.ZipFileZipEntrySource
- All Implemented Interfaces:
Closeable,AutoCloseable,ZipEntrySource
A ZipEntrySource wrapper around a ZipFile.
Should be as low in terms of memory as a
normal ZipFile implementation is.
-
Constructor Summary
ConstructorsConstructorDescriptionZipFileZipEntrySource(org.apache.commons.compress.archivers.zip.ZipFile zipFile) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Indicates we are done with reading, and resources may be freedEnumeration<? extends org.apache.commons.compress.archivers.zip.ZipArchiveEntry>Returns an Enumeration of all the Entriesorg.apache.commons.compress.archivers.zip.ZipArchiveEntryReturn an entry by its pathgetInputStream(org.apache.commons.compress.archivers.zip.ZipArchiveEntry entry) Returns an InputStream of the decompressed data that makes up the entrybooleanisClosed()Has close been called already?
-
Constructor Details
-
ZipFileZipEntrySource
public ZipFileZipEntrySource(org.apache.commons.compress.archivers.zip.ZipFile zipFile)
-
-
Method Details
-
close
Description copied from interface:ZipEntrySourceIndicates we are done with reading, and resources may be freed- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceZipEntrySource- Throws:
IOException
-
isClosed
public boolean isClosed()Description copied from interface:ZipEntrySourceHas close been called already?- Specified by:
isClosedin interfaceZipEntrySource
-
getEntries
public Enumeration<? extends org.apache.commons.compress.archivers.zip.ZipArchiveEntry> getEntries()Description copied from interface:ZipEntrySourceReturns an Enumeration of all the Entries- Specified by:
getEntriesin interfaceZipEntrySource
-
getInputStream
public InputStream getInputStream(org.apache.commons.compress.archivers.zip.ZipArchiveEntry entry) throws IOException Description copied from interface:ZipEntrySourceReturns an InputStream of the decompressed data that makes up the entry- Specified by:
getInputStreamin interfaceZipEntrySource- Throws:
IOException
-
getEntry
Description copied from interface:ZipEntrySourceReturn an entry by its path- Specified by:
getEntryin interfaceZipEntrySource- Parameters:
path- the path in unix-notation- Returns:
- the entry or
nullif not found
-