public EncryptedZIPExportWriter(String zipFileName, String password) { try { this.zipFile = new File(zipFileName); if (zipFile.exists()) { throw new IllegalStateException("File " + zipFileName + " already exists"); } this.objectMapper = JsonSerialization.mapper; AESEncrypter encrypter = new AESEncrypterBC(); this.encrypter = new AesZipFileEncrypter(this.zipFile, encrypter); this.password = password; } catch (IOException ioe) { throw new RuntimeException(ioe); } }
/** * Encrypt all files from an existing zip to one new "zipOutFile" using "password". */ public static void zipAndEncryptAll(File inZipFile, File outFile, String password, AESEncrypter encrypter) throws IOException { AesZipFileEncrypter enc = new AesZipFileEncrypter(outFile,encrypter); try { enc.addAll(inZipFile, password); } finally { enc.close(); } }
/** * Zip + encrypt one "inFile" to one "outZipFile" using "password". */ public static void zipAndEncrypt(File inFile, File outFile, String password, AESEncrypter encrypter) throws IOException { AesZipFileEncrypter enc = new AesZipFileEncrypter(outFile,encrypter); try { enc.add(inFile, password); } finally { enc.close(); } }
/** * Zip + encrypt one "inFile" to one "outZipFile" using "password". */ public static void zipAndEncrypt(File inFile, File outFile, String password, AESEncrypter encrypter) throws IOException { AesZipFileEncrypter enc = new AesZipFileEncrypter(outFile,encrypter); try { enc.add(inFile, password); } finally { enc.close(); } }
/** * Encrypt all files from an existing zip to one new "zipOutFile" using "password". */ public static void zipAndEncryptAll(File inZipFile, File outFile, String password, AESEncrypter encrypter) throws IOException { AesZipFileEncrypter enc = new AesZipFileEncrypter(outFile,encrypter); try { enc.addAll(inZipFile, password); } finally { enc.close(); } }
zfe = new AesZipFileEncrypter(filePath, new AESEncrypterBC()); } catch (IOException e) { failedException = e;