Package org.apache.poi.openxml4j.util
Class ZipFileZipEntrySource
- java.lang.Object
-
- org.apache.poi.openxml4j.util.ZipFileZipEntrySource
-
- All Implemented Interfaces:
Closeable,AutoCloseable,ZipEntrySource
public class ZipFileZipEntrySource extends Object implements ZipEntrySource
A ZipEntrySource wrapper around a ZipFile. Should be as low in terms of memory as a normal ZipFile implementation is.
-
-
Constructor Summary
Constructors Constructor Description ZipFileZipEntrySource(org.apache.commons.compress.archivers.zip.ZipFile zipFile)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Indicates we are done with reading, and resources may be freedEnumeration<? extends org.apache.commons.compress.archivers.zip.ZipArchiveEntry>getEntries()Returns an Enumeration of all the Entriesorg.apache.commons.compress.archivers.zip.ZipArchiveEntrygetEntry(String path)Return an entry by its pathInputStreamgetInputStream(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?
-
-
-
Method Detail
-
close
public void close() throws IOExceptionDescription 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
public org.apache.commons.compress.archivers.zip.ZipArchiveEntry getEntry(String path)
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
-
-