Package org.apache.poi.poifs.crypt.temp
Class AesZipFileZipEntrySource
- java.lang.Object
-
- org.apache.poi.poifs.crypt.temp.AesZipFileZipEntrySource
-
- All Implemented Interfaces:
Closeable,AutoCloseable,ZipEntrySource
@Beta public final class AesZipFileZipEntrySource extends Object implements ZipEntrySource
An exampleZipEntrySourcethat has encrypted temp files to ensure that sensitive data is not stored in raw format on disk.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Indicates we are done with reading, and resources may be freedstatic AesZipFileZipEntrySourcecreateZipEntrySource(InputStream is)Enumeration<? extends org.apache.commons.compress.archivers.zip.ZipArchiveEntry>getEntries()Note: the file sizes are rounded up to the next cipher block size, so don't rely on file sizes of these custom encrypted zip file entries!org.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
-
getEntries
public Enumeration<? extends org.apache.commons.compress.archivers.zip.ZipArchiveEntry> getEntries()
Note: the file sizes are rounded up to the next cipher block size, so don't rely on file sizes of these custom encrypted zip file entries!- Specified by:
getEntriesin interfaceZipEntrySource
-
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
-
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
-
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
-
createZipEntrySource
public static AesZipFileZipEntrySource createZipEntrySource(InputStream is) throws IOException
- Throws:
IOException
-
-