Create a zip file with multiple files in Pega V851 and is password protected too
One of my friends came with a requirement like- Is there anyway we can create a zip file with multiple files from Pega? Also, he asked me to protect the final zip file after finishing the process .After digging a bit in the net, I got an opensource (zip4j) since we don't find a direct OOTB feature for this usecase. This opensource was built by Srikanth Lingala and is based on pure java. There might be other opensources to create a zip file in the market but this one provides security on the final zip file. This opensource comes with a single jar file to import in Pega to get all necessary files to work on this exercise.
Here is the link to download the jar file: https://jar-download.com/artifacts/net.lingala.zip4j/zip4j/1.3.2/source-code
The below Pega function needs a parameter with ZipFileName and the return value is a string of Success/Fail. Logic is simple. Pass the files in parameters from the DT and construct the path in tomcat to create a zip file in the same path using the java code. All the steps are clearly documented in the code to implement independently. Feel free to contact me offline.
References:
1) Google.com
2) https://mvnrepository.com/
3) Pega Community Site
4) Pega Developers Hep
