Last active
September 13, 2021 17:18
-
-
Save fernandojsg/5795063 to your computer and use it in GitHub Desktop.
MIRTH: Create encrypted ZIP (File)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
importPackage(Packages.net.lingala.zip4j); | |
var zipFile = new Packages.net.lingala.zip4j.core.ZipFile("d:\\test.zip"); | |
var filesToAdd = new java.util.ArrayList(); | |
filesToAdd.add(new java.io.File("d:\\test.dcm")); | |
var parameters = new Packages.net.lingala.zip4j.model.ZipParameters(); | |
//parameters.setCompressionMethod(Packages.net.lingala.zip4j.util.Zip4jConstants.COMP_STORE); // set compression method to store compression | |
parameters.setEncryptFiles(true); | |
// Set the encryption method to AES Zip Encryption | |
parameters.setEncryptionMethod(Packages.net.lingala.zip4j.util.Zip4jConstants.ENC_METHOD_AES); | |
parameters.setAesKeyStrength(Packages.net.lingala.zip4j.util.Zip4jConstants.AES_STRENGTH_256); | |
// Standard zip Encryption | |
//parameters.setEncryptionMethod(Zip4jConstants.ENC_METHOD_STANDARD); | |
parameters.setPassword("pass"); | |
zipFile.addFiles(filesToAdd, parameters); |
Hi am not able to get this to function in Mirth 3.10 can you elaborate?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is fantastic. Thanks for sharing,.