Sidebar

how to zip a file folder using passcode?

0 votes
397 views
asked Jul 31, 2018 by (330 points)

hey i am using following script to zip a folder files.

and this code is working fine now i want to apply passcode on zipped file so what are the required modification i need to do in mapping script? 

soft copy of script is:-

var zipFilePath="D:\\readytodelete\\folder2\\out\\file.zip";
var directoryToZip="D:\\readytodelete\\folder2\\in";
var zipFileStream = new java.util.zip.ZipOutputStream(new java.io.FileOutputStream(zipFilePath));
try {
   addDirectoryFilesStream(directoryToZip, '', zipFileStream);
} finally {
   zipFileStream.finish();
   zipFileStream.flush();
   zipFileStream.closeEntry();
   zipFileStream.close();
}

 

1 Answer

0 votes

It sounds like adding a password to a zip file is not natively available in Java, but could be accomplished using some 3rd party libraries.  https://stackoverflow.com/questions/10587561/password-protected-zip-file-in-java

You can include the jars by adding external libraries: https://www.qvera.com/kb/index.php/256/what-are-external-libraries-or-jar-files

answered Jul 31, 2018 by mike-r-7535 (13,830 points)
commented Aug 1, 2018 by (330 points)
as i am new bie for qie,, so please send me end to end solution for that task with snapshots ,,so that i get to know how to add third party jars in qie and how to use that unzip with passcode mapping script,,,,,that is  really very important for us.
thank you v much sir.
commented Aug 2, 2018 by mike-r-7535 (13,830 points)
@heerendra-s-5987 I don't have an existing configuration for this custom request.  If you are looking for us to develop a custom solution for you, please contact sales. If you are wanting to create your own solution, we help answer specific questions and teach you as you develop the solution.

I recommend that you create a simple Java program that performs the zipping and unzipping with the encryption libraries that you require.  When you have those working examples, we can help you convert that to a QIE script.
...