Package org.apache.poi.openxml4j.util
Class ZipFileZipEntrySource
- java.lang.Object
-
- org.apache.poi.openxml4j.util.ZipFileZipEntrySource
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,ZipEntrySource
public class ZipFileZipEntrySource extends java.lang.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(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 freedjava.util.Enumeration<? extends ZipArchiveEntry>getEntries()Returns an Enumeration of all the EntriesZipArchiveEntrygetEntry(java.lang.String path)Return an entry by its pathjava.io.InputStreamgetInputStream(ZipArchiveEntry entry)Returns an InputStream of the decompressed data that makes up the entrybooleanisClosed()Has close been called already?
-
-
-
Constructor Detail
-
ZipFileZipEntrySource
public ZipFileZipEntrySource(ZipFile zipFile)
-
-
Method Detail
-
close
public void close() throws java.io.IOExceptionDescription copied from interface:ZipEntrySourceIndicates we are done with reading, and resources may be freed- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfaceZipEntrySource- Throws:
java.io.IOException
-
isClosed
public boolean isClosed()
Description copied from interface:ZipEntrySourceHas close been called already?- Specified by:
isClosedin interfaceZipEntrySource
-
getEntries
public java.util.Enumeration<? extends ZipArchiveEntry> getEntries()
Description copied from interface:ZipEntrySourceReturns an Enumeration of all the Entries- Specified by:
getEntriesin interfaceZipEntrySource
-
getInputStream
public java.io.InputStream getInputStream(ZipArchiveEntry entry) throws java.io.IOException
Description copied from interface:ZipEntrySourceReturns an InputStream of the decompressed data that makes up the entry- Specified by:
getInputStreamin interfaceZipEntrySource- Throws:
java.io.IOException
-
getEntry
public ZipArchiveEntry getEntry(java.lang.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
-
-