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 TypeMethodDescriptionvoid
close()
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.ZipArchiveEntry
Return an entry by its pathgetInputStream
(org.apache.commons.compress.archivers.zip.ZipArchiveEntry entry) Returns an InputStream of the decompressed data that makes up the entryboolean
isClosed()
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:ZipEntrySource
Indicates we are done with reading, and resources may be freed- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceZipEntrySource
- Throws:
IOException
-
isClosed
public boolean isClosed()Description copied from interface:ZipEntrySource
Has close been called already?- Specified by:
isClosed
in interfaceZipEntrySource
-
getEntries
public Enumeration<? extends org.apache.commons.compress.archivers.zip.ZipArchiveEntry> getEntries()Description copied from interface:ZipEntrySource
Returns an Enumeration of all the Entries- Specified by:
getEntries
in interfaceZipEntrySource
-
getInputStream
public InputStream getInputStream(org.apache.commons.compress.archivers.zip.ZipArchiveEntry entry) throws IOException Description copied from interface:ZipEntrySource
Returns an InputStream of the decompressed data that makes up the entry- Specified by:
getInputStream
in interfaceZipEntrySource
- Throws:
IOException
-
getEntry
Description copied from interface:ZipEntrySource
Return an entry by its path- Specified by:
getEntry
in interfaceZipEntrySource
- Parameters:
path
- the path in unix-notation- Returns:
- the entry or
null
if not found
-