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
1
vote
1 answer

How to zip folder and sub-folder using zip4j and outputstream

In the program that I am writing, I take the uri of the location to save the zip file from a user. Then, I try to zip the files and folders using zip4j library and outpustream in Android. I modified the code in this Stackoverflow answer and used…
Corey
  • 111
  • 2
  • 14
1
vote
2 answers

NiFi ExecuteScript output is corrupted using zip4j

@Grab('net.lingala.zip4j:zip4j:2.2.8') import net.lingala.zip4j.io.outputstream.ZipOutputStream; import net.lingala.zip4j.model.ZipParameters; import net.lingala.zip4j.model.enums.EncryptionMethod; import org.apache.commons.io.IOUtils flowFile =…
lueenavarro
  • 528
  • 10
  • 20
1
vote
2 answers

Finding start of compressed data for items in a zip with zip4j

I'm trying to find the start of compressed data for each zip entry using zip4j. Great library for returning the local header offset, which Java's ZipFile does not do. However I'm wondering if there is a more reliable way than what I'm doing below…
BrianY
  • 195
  • 10
1
vote
1 answer

"ZipException - unexpected end of file when reading short buff" while reading Zip contents into a string

I'm using the zip4j library to zip and unzip files (xml in particular). For an incoming String, I need to write the contents of the String into an xml file, and then zip that file into a zip-file, before transferring the byte[] content of the zip…
GopherGopher
  • 376
  • 1
  • 2
  • 16
1
vote
1 answer

Extract zip file to HDFS using Java

I'm using Java-Spark, I'm get message from Kafka topic that indicate on zip file path, I want to take this zip file and to extract it to HDFS. I have code that read messages from Kafka with Spark Structured Stream. What is the way to extract the…
Ya Ko
  • 509
  • 2
  • 4
  • 19
1
vote
1 answer

Can zip4j be used to extract Tar files?

In an application we use the zip4j library to decompress zip files. File toBeExtractedFile = new File("valid/path/to/File"); ZipFile zipFile = new…
Stephan Hogenboom
  • 1,543
  • 2
  • 17
  • 29
1
vote
1 answer

How to create a password-protected zip folder in Java?

It is important that the zip file should be password protected and not the files contained inside the zip. It means that when I double-click on the zip file it should ask me the password before showing the contents of the zip. I have tried Zip4j and…
Pratap
  • 655
  • 2
  • 10
  • 20
1
vote
1 answer

Exception unzipping in java war file under Linux

I have an issue when uncompressing a zip file in my java application. It is a web service packaged as a war file and running under jetty 9.4. This is my (shortened) stack trace 2018-05-10 20:13:48,180 ERROR [ProductPublisherHelper:63]…
Thomas
  • 1,967
  • 2
  • 15
  • 22
1
vote
3 answers

Unzip password protected zip file using Java throws NullPointerException

I need to unzip a password protected zip file. so far I got this with the help of internet and im trying to understand the code. but it throws nullpointerexception. and I'm really confused. is it the "child" or something else. please kindly…
Blank
  • 11
  • 2
  • 14
1
vote
1 answer

Exempt files and folder with Zip4j in Java

I have created a backup system which I sell called EasyBackup for servers. The system works great, and it uses zipped files. Someone requested that I add a feature to add a password to the zipped folder, but I could not find a way to do that with…
Forseth11
  • 1,418
  • 1
  • 12
  • 21
1
vote
1 answer

Decompress .zip file with Java using zip4j

I'm trying to decompress a zip file with the API ZipFile from net.lingala.zip4j public static void unzip(File zipf, File baseDir) throws IOException, ZipException { String source = zipf.getAbsolutePath();//"some/compressed/file.zip"; String…
Selma BA
  • 149
  • 3
  • 18
1
vote
0 answers

using zip4j library to export import zip file in android application

I am having an application which need to take data from DB and export as zip file. Since my zip file needs to be password protected, i checked for some libraries. I got zip4j as a library which helps me in password encryption and export as zip…
Sunil
  • 521
  • 1
  • 7
  • 24
1
vote
1 answer

Zip4j libary: How do I check if the zip file is empty?

Hello I am using the zip4j library for Java to extract zip file to a directory. I get this zip file from the internet. Everything works fine however I get this exception when the zip file is empty. 12-08 16:52:00.964 29829-30843/ W/System.err:…
Ersen Osman
  • 7,067
  • 8
  • 47
  • 80
1
vote
1 answer

Java unzip .zip file without subfolder

I am using zip4j to do decompression, but now I need to decompress the .zip file without original folder structure. e.g. desktop/abc.zip/ /a /b/ /x.txt /y.txt /z.txt I…
Ian
  • 21
  • 1
1
vote
1 answer

unzip is too slow in java/android zip4j

I'm using Zip4j library in android. I'm unzipping a file with password, it works very slow. Here is how I do it: public boolean unzipFile(){ String path= FileController.getInstance().getAbsolutePath(); String source = path+"/program.zip"; …
Jenya Kirmiza
  • 511
  • 8
  • 21
1 2
3
8 9