-1

I wanna to know How to Create Empty Zip File Using Zip4j Library

Shouldn't this line of code be enough to create an empty zip file? when i am tried it, it isn't work.

ZipFile zipFile1 = new ZipFile(zipFilePath);

my question is for this lib : https://github.com/srikanth-lingala/zip4j

Edit: why all answer told me to create ZipFile nd add file in it then remove that file !! I just wanna create ZipFile directly without any complications, just function get path like "/storage/emulated/0/ZipPro/zipPro.zip" and create this zip file "zipPro.zip"

...................................................................................

1 Answers1

0
            File file = new File("path/to/folder/FOLDER_NAME");
            if(!file.exists())
                file.mkdir();
            ZipFile zipFile = new ZipFile(file);
            zipFile.extractAll(file.getPath());

Please don't forget to upvote if this answer helped you!

FARS
  • 313
  • 6
  • 20