public class AesZipFileEncrypter
extends java.lang.Object
Constructor and Description |
---|
AesZipFileEncrypter(java.io.File outFile) |
AesZipFileEncrypter(java.io.OutputStream outFile) |
AesZipFileEncrypter(java.lang.String pathName) |
Modifier and Type | Method and Description |
---|---|
void |
add(java.io.File file,
java.lang.String password)
Add un-encrypted + un-zipped file to encrypted zip file.
|
void |
add(java.io.File file,
java.lang.String pathForEntry,
java.lang.String password)
Add un-encrypted + un-zipped file to encrypted zip file.
|
void |
add(java.lang.String name,
java.io.InputStream is,
java.lang.String password)
Add un-encrypted + un-zipped InputStream contents as file "name" to encrypted zip file.
|
void |
addAll(java.io.File pathToZipFile,
java.lang.String password)
Take all elements (files) from zip file and add them ENCRYPTED with password to the new zip
file created with this instance.
|
void |
close()
Client is required to call this method after he added all entries so the final archive part is
written.
|
void |
setComment(java.lang.String comment) |
static void |
zip(java.io.File inFile,
java.io.File outFile)
Zip contents of inFile to outFile.
|
static void |
zipAndEncrypt(java.io.File inFile,
java.io.File outFile,
java.lang.String password)
Zip + encrypt one "inFile" to one "outZipFile" using "password".
|
static void |
zipAndEncryptAll(java.io.File inZipFile,
java.io.File outFile,
java.lang.String password)
Encrypt all files from an existing zip to one new "zipOutFile" using "password".
|
public AesZipFileEncrypter(java.lang.String pathName) throws java.io.IOException
pathName
- to output zip file (aes encrypted zip file)java.io.IOException
public AesZipFileEncrypter(java.io.File outFile) throws java.io.IOException
outFile
- output file (aes encrypted zip file)java.io.IOException
public AesZipFileEncrypter(java.io.OutputStream outFile) throws java.io.IOException
java.io.IOException
public void add(java.io.File file, java.lang.String pathForEntry, java.lang.String password) throws java.io.IOException, java.io.UnsupportedEncodingException
file
- to addpathForEntry
- to be used for addition of the file (path within zip file)password
- to be used for encryptionjava.io.IOException
java.io.UnsupportedEncodingException
public void add(java.io.File file, java.lang.String password) throws java.io.IOException, java.io.UnsupportedEncodingException
file
- to add, provides the path of the file within the zip file via its getPath()password
- to be used for encryptionjava.io.IOException
java.io.UnsupportedEncodingException
public void add(java.lang.String name, java.io.InputStream is, java.lang.String password) throws java.io.IOException, java.io.UnsupportedEncodingException
name
- of the new zipEntry within the zip fileis
- provides the data to be addedpassword
- to be used for encryptionjava.io.IOException
java.io.UnsupportedEncodingException
public static void zip(java.io.File inFile, java.io.File outFile) throws java.io.IOException
java.io.IOException
public void addAll(java.io.File pathToZipFile, java.lang.String password) throws java.io.IOException
add(File, String)
method does not need an additional zip file, this method
comes in handy, when your input data is larger than your available memory.pathToZipFile
- provides zipFileEntries for encryptionpassword
- used to perform the encryptionjava.io.IOException
public void setComment(java.lang.String comment)
public void close() throws java.io.IOException
java.io.IOException
public static void zipAndEncrypt(java.io.File inFile, java.io.File outFile, java.lang.String password) throws java.io.IOException
java.io.IOException
public static void zipAndEncryptAll(java.io.File inZipFile, java.io.File outFile, java.lang.String password) throws java.io.IOException
java.io.IOException