I'm trying to create password protected zip fileby the following code:
ZipParameters zipParameters = new ZipParameters();
zipParameters.setEncryptFiles(true);
zipParameters.setEncryptionMethod(EncryptionMethod.AES);
List<File> filesToAdd = Arrays.asList(new File("aFile.txt"), new File("bFile.txt"));
ZipFile zipFile = new ZipFile("compressed.zip", "password".toCharArray());
zipFile.addFiles(filesToAdd, zipParameters);
The problem is that the password is on the level of the files in created zip but not on the zip itself. Meaning after the zip created I can enter the zip but I have to enter password to open "aFile.txt" or "bFile.txt". What I want is when I try to open "compressed.zip", the password window will show up before I can see the file names in the zip. Any help is appreciated, thanks in advance.