3636import net .lingala .zip4j .model .enums .CompressionLevel ;
3737import net .lingala .zip4j .model .enums .EncryptionMethod ;
3838import net .lingala .zip4j .model .enums .AesKeyStrength ;
39+ import net .lingala .zip4j .progress .ProgressMonitor ;
3940
4041import java .nio .charset .Charset ;
4142
@@ -67,7 +68,7 @@ public void isPasswordProtected(final String zipFilePath, final Promise promise)
6768
6869 @ ReactMethod
6970 public void unzipWithPassword (final String zipFilePath , final String destDirectory ,
70- final String password , final Promise promise ) {
71+ final String password , final Promise promise ) {
7172 new Thread (new Runnable () {
7273 @ Override
7374 public void run () {
@@ -92,11 +93,11 @@ public void run() {
9293 String destDirCanonicalPath = (new File (destDirectory ).getCanonicalPath ()) + File .separator ;
9394
9495 if (!canonicalPath .startsWith (destDirCanonicalPath )) {
95- throw new SecurityException (String .format ("Found Zip Path Traversal Vulnerability with %s" , canonicalPath ));
96+ throw new SecurityException (String .format ("Found Zip Path Traversal Vulnerability with %s" , canonicalPath ));
9697 }
9798
9899 if (!fileHeader .isDirectory ()) {
99- zipFile .extractFile (fileHeader , destDirectory );
100+ zipFile .extractFile (fileHeader , destDirectory );
100101 extractedFileNames .add (fileHeader .getFileName ());
101102 }
102103 updateProgress (i + 1 , totalFiles , zipFilePath );
@@ -237,7 +238,7 @@ public void run() {
237238 String destDirCanonicalPath = (new File (destDirectory ).getCanonicalPath ()) + File .separator ;
238239
239240 if (!canonicalPath .startsWith (destDirCanonicalPath )) {
240- throw new SecurityException (String .format ("Found Zip Path Traversal Vulnerability with %s" , canonicalPath ));
241+ throw new SecurityException (String .format ("Found Zip Path Traversal Vulnerability with %s" , canonicalPath ));
241242 }
242243
243244 if (!fout .exists ()) {
@@ -300,21 +301,21 @@ public void zipFolder(final String folder, final String destFile, final Promise
300301
301302 @ ReactMethod
302303 public void zipFilesWithPassword (final ReadableArray files , final String destFile , final String password ,
303- String encryptionMethod , Promise promise ) {
304+ String encryptionMethod , Promise promise ) {
304305 zipWithPassword (files .toArrayList (), destFile , password , encryptionMethod , promise );
305306 }
306307
307308
308309 @ ReactMethod
309310 public void zipFolderWithPassword (final String folder , final String destFile , final String password ,
310- String encryptionMethod , Promise promise ) {
311+ String encryptionMethod , Promise promise ) {
311312 ArrayList <Object > folderAsArrayList = new ArrayList <>();
312313 folderAsArrayList .add (folder );
313314 zipWithPassword (folderAsArrayList , destFile , password , encryptionMethod , promise );
314315 }
315316
316317 private void zipWithPassword (final ArrayList <Object > filesOrDirectory , final String destFile , final String password ,
317- String encryptionMethod , Promise promise ) {
318+ String encryptionMethod , Promise promise ) {
318319 try {
319320
320321 ZipParameters parameters = new ZipParameters ();
0 commit comments