Package org.apache.poi.poifs.crypt.temp
Class AesZipFileZipEntrySource
- java.lang.Object
-
- org.apache.poi.poifs.crypt.temp.AesZipFileZipEntrySource
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,ZipEntrySource
@Beta public final class AesZipFileZipEntrySource extends java.lang.Object implements ZipEntrySource
An exampleZipEntrySource
that 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 void
close()
Indicates we are done with reading, and resources may be freedstatic AesZipFileZipEntrySource
createZipEntrySource(java.io.InputStream is)
java.util.Enumeration<? extends 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!ZipArchiveEntry
getEntry(java.lang.String path)
Return an entry by its pathjava.io.InputStream
getInputStream(ZipArchiveEntry entry)
Returns an InputStream of the decompressed data that makes up the entryboolean
isClosed()
Has close been called already?
-
-
-
Method Detail
-
getEntries
public java.util.Enumeration<? extends 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:
getEntries
in interfaceZipEntrySource
-
getEntry
public ZipArchiveEntry getEntry(java.lang.String path)
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
-
getInputStream
public java.io.InputStream getInputStream(ZipArchiveEntry entry) throws java.io.IOException
Description copied from interface:ZipEntrySource
Returns an InputStream of the decompressed data that makes up the entry- Specified by:
getInputStream
in interfaceZipEntrySource
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
Description copied from interface:ZipEntrySource
Indicates we are done with reading, and resources may be freed- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Specified by:
close
in interfaceZipEntrySource
- Throws:
java.io.IOException
-
isClosed
public boolean isClosed()
Description copied from interface:ZipEntrySource
Has close been called already?- Specified by:
isClosed
in interfaceZipEntrySource
-
createZipEntrySource
public static AesZipFileZipEntrySource createZipEntrySource(java.io.InputStream is) throws java.io.IOException
- Throws:
java.io.IOException
-
-