Questions tagged [zip4j]

A java open-source library to handle Zip files.

A library to work with .zip files. It has the following features

  • Create, Add, Extract, Update, Remove files from a Zip file
  • Read/Write password protected Zip files
  • Supports AES 128/256 Encryption
  • Supports Standard Zip Encryption
  • Supports Zip64 format
  • Supports Store (No Compression) and Deflate compression method
  • Create or extract files from Split Zip files (Ex: z01, z02,...zip)
  • Supports Unicode file names
  • Progress Monitor

The project home page: http://www.lingala.net/zip4j/

126 questions
6
votes
1 answer

Create and Read password protected ZIP using streams.(Not physical File)

I need to implement a solution that creates password protected ZIP streams and save to database as a blob. Also need to read the password protected content from the database read as the stream. This should not create a physical File. Standard…
user3693532
  • 61
  • 1
  • 3
5
votes
2 answers

zip4j: java.lang.NoClassDefFoundError

I'm trying to use zip4j in my project to create a downloadable zip of files. The app is working fine for my friends but whenever i try to run it i get this error: java.lang.NoClassDefFoundError: net/lingala/zip4j/exception/ZipException at…
Marcin Zareba
  • 430
  • 7
  • 18
4
votes
0 answers

How to check if a zip file is password protected using java?

I want to check whether a zip file is password protected or not using java? The zip file is AES_256 encrypted.
4
votes
2 answers

How to add a file in a specific folder (in the ZIP)

The following code, how to add a file to a zip using java: String source = "C:/Users/XXXXX/Desktop/Helicopter.zip"; try { ZipFile zipFile = new ZipFile(source); ZipParameters parameters = new ZipParameters(); zipFile.addFile(new…
codepleb
  • 10,086
  • 14
  • 69
  • 111
3
votes
2 answers

Replacing the MANIFEST.MF file in a JAR programmatically

I want to modify the MANIFEST.MF after creating the JAR to exclude certain Class-Path entries. For this I decided to use zip4j. Extraction seems to work fine but for putting the MANIFEST.MF file back into the JAR, I use the following code: String…
BullyWiiPlaza
  • 17,329
  • 10
  • 113
  • 185
3
votes
1 answer

Cannot unzip files created with Windows "Sent to compressed folder" in scala/java

I zipped a bunch of IIS log files on a windows 2008 r2 vm by selecting them in Windows Explorer and then using the Send To -> Compressed zipped folder. I wrote different programs in scala using java.util.ZipFile, zip4j and apache commons compress…
boggy
  • 3,674
  • 3
  • 33
  • 56
3
votes
3 answers

Zip4J and Zip Slip vulnerability

Zip4J is listed as vulnerable for Zip Slip. They claim that Zip4J 1.3.3 has the fix. However the JAR we download from their site is empty and has no classes. Did anyone manage to get the 1.3.3 version? Any other alternative for a Zip utility that…
Harippriya
  • 53
  • 8
3
votes
4 answers

zip4j, extract a password protected file from an inputstream (blob inputstream which is a zip file)

I have a database that contains blobs and a password protected zip inside this database, using the standard File object approach i traditionally see File zipFile = new File("C:\\file.zip"); net.lingala.zip4j.core.ZipFile…
jyonkheel
  • 443
  • 4
  • 17
3
votes
0 answers
3
votes
1 answer

Extract zip and re-zip with password in java

I am trying to extract list of zip files from folder and then re-zipping them with password. The problem is while re-zipping, the iteration/loop is not stopping. Also, re-zipped files should be a separate zip file each rather than merging all…
kittu
  • 6,662
  • 21
  • 91
  • 185
2
votes
1 answer

Javafx Gradle make exception org.gradle.process.internal.ExecException finished with non-zero exit value 1 when use lib net.lingala.zip4j

I had use zip4j lib net.lingala.zip4j for build winrar project javafx but had this error Caused by: org.gradle.process.internal.ExecException: Process 'command 'C:/Program Files/Java/jdk-11.0.14/bin/java.exe'' finished with non-zero exit value 1 …
quangdang
  • 116
  • 7
2
votes
0 answers

Why does my folder has no icon when creating with zip4j?

So I want to create a .zip with the src of a project in (Using Maven Projects). First I get the sourceCode Header Folder with 'projectLocation + "/src/main"', and then get all Files of the Head File with private static List
Mxrlin
  • 23
  • 6
2
votes
2 answers

How to enable password for zip archive in java?

I am able to create a zip file and add files using the zip4j library but the problem is the password is set only for the files inside the zip, so I am able to open the zip and see the file list, which I don't want. I want to set a password for the…
2
votes
0 answers

Cant delete a file after editing it with zip4j (Java)

I am trying to copy a jar file into an other jarfile. so to get them together i unzip both to Infect.BIND_TMP. After that i go ahead and delete "first" but here Comes the Problem: I get "false" returned by file.delete(); Did i not Close all streams?…
Julius
  • 35
  • 2
  • 9
2
votes
3 answers

Exception when create zipFile in Android with Zip4j: Probably not a zip file or a corrupted zip file

I meet a problem when using zip4j library to generate zipfile in android, here's the code : try { ZipFile zipFile = new ZipFile(dest); zipFile.setFileNameCharset("GBK"); if (srcFile.isDirectory()) { zipFile.addFolder(srcFile,…
Mic
  • 23
  • 1
  • 5
1
2 3
8 9