0

I am creating encrypted zip using zip4j_1.3.2.jar. below is my rough code. zipParameters.setFileNameInZip(fileName); in this line if fileName is containing slash special character or filename equals to "/" after downloading zip file, file size is 0 bytes. with others specials its working fine.I am unable to fine any documentation regarding this special character restriction. I want to know what are the others restriction we have in net.lingala.zip4j.io.ZipOutputStream, net.lingala.zip4j.model.ZipParameters.

     ZipOutputStream zout = new ZipOutputStream(ous);
            ZipParameters zipParameters = new ZipParameters();
            zipParameters.setCompressionMethod(Zip4jConstants.COMP_DEFLATE);
            zipParameters.setCompressionLevel(Zip4jConstants.DEFLATE_LEVEL_FASTEST);
            zipParameters.setEncryptFiles(true);
            zipParameters.setEncryptionMethod(Zip4jConstants.ENC_METHOD_STANDARD);
            zipParameters.setPassword(password);
            zipParameters.setSourceExternalStream(true);
            zipParameters.setFileNameInZip(fileName);
            zout.putNextEntry(null, zipParameters);
            try {
                byte[] buffer = new byte[4096];
                int num;
                while ((num = bis.read(buffer)) != -1) {
                    zout.write(buffer, 0, num);
                }
                zout.flush();
                zout.closeEntry();
                zout.finish();
            } finally {
                //closing all streams 
            }

if some one knows about this restriction or documentation. please share to me thanks

0 Answers0