org.apache.poi.poifs.crypt.temp
Class AesZipFileZipEntrySource

java.lang.Object
  extended by org.apache.poi.poifs.crypt.temp.AesZipFileZipEntrySource
All Implemented Interfaces:
java.io.Closeable, ZipEntrySource

@Beta
public class AesZipFileZipEntrySource
extends java.lang.Object
implements ZipEntrySource

An example ZipEntrySource that has encrypted temp files to ensure that sensitive data is not stored in raw format on disk.


Constructor Summary
AesZipFileZipEntrySource(java.io.File tmpFile, javax.crypto.Cipher ci)
           
 
Method Summary
 void close()
          Indicates we are done with reading, and resources may be freed
static AesZipFileZipEntrySource createZipEntrySource(java.io.InputStream is)
           
 java.util.Enumeration<? extends java.util.zip.ZipEntry> 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!
 java.io.InputStream getInputStream(java.util.zip.ZipEntry entry)
          Returns an InputStream of the decompressed data that makes up the entry
 boolean isClosed()
          Has close been called already?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AesZipFileZipEntrySource

public AesZipFileZipEntrySource(java.io.File tmpFile,
                                javax.crypto.Cipher ci)
                         throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getEntries

public java.util.Enumeration<? extends java.util.zip.ZipEntry> 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 interface ZipEntrySource

getInputStream

public java.io.InputStream getInputStream(java.util.zip.ZipEntry 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 interface ZipEntrySource
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 interface java.io.Closeable
Specified by:
close in interface ZipEntrySource
Throws:
java.io.IOException

isClosed

public boolean isClosed()
Description copied from interface: ZipEntrySource
Has close been called already?

Specified by:
isClosed in interface ZipEntrySource

createZipEntrySource

public static AesZipFileZipEntrySource createZipEntrySource(java.io.InputStream is)
                                                     throws java.io.IOException,
                                                            java.security.GeneralSecurityException
Throws:
java.io.IOException
java.security.GeneralSecurityException