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

Unable to zip files using zip4j

Unable to create a zip file from list of directories. I am able to read the directories and print them. How ever, when I try to zip them, its throwing error: net.lingala.zip4j.exception.ZipException: java.io.FileNotFoundException:…
kittu
  • 6,662
  • 21
  • 91
  • 185
1
vote
2 answers

Generating Zip for Download using Zip4j

i try to use Zip4j to generate a zip file for download. But i always get the error: 2015-05-09 15:56:24.306 ERROR 11748 --- [nio-8080-exec-4] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context…
Matombo
  • 77
  • 1
  • 9
1
vote
3 answers

Replace specific file inside Zip archive without extracting the whole archive in Java

I'm trying to get a specific file inside a Zip Archive, extract it, Encrypt it, and then get it back inside the archive replacing the origial one. here's what I've tried so far.. public static boolean encryptXML(File ZipArchive, String key) throws…
Aboud Zakaria
  • 567
  • 9
  • 25
1
vote
1 answer

Any way to get Compression method in java using zip4j library?

I want to return boolean to check if my zip file is compressed . Will be an advantage if i can also get what Compression method has been used. For now I am just checking is it is Encrypted and is valid zip. Please help if it is possible using zip4j…
Tushar Khanna
  • 428
  • 6
  • 22
1
vote
1 answer

JAVA - zip4j, extract all text files ONLY from a zip file

we can extract all the files from a zoip filder using extractAll method given in zip4j, but what if i need to extract only one kind of files,say only text files or only files which have a certain sub-string in the name of the file?? is there a way…
Vasanth Nag K V
  • 4,860
  • 5
  • 24
  • 48
1
vote
1 answer

Decompress folder without overwriting new files

I want to decompress a large folder in ZIP format with nested subdirectories in a directory that already exists. The files inside the ZIP folder can exist in the decompressed directory. I need to keep the previous files only when the date of that…
1
vote
1 answer

Java zip library for large quantities of files

I have over 100.000 files and almost 4GB of them. Its html so it can be compressed for 70-80%. The files ranges from 200 KB to almost 10 MB. I am developing an application transforming the files from xml to html. In the end the application will…
Avec
  • 1,626
  • 21
  • 31
1
vote
4 answers

zip4j How to extract a directory

I need to extract a directory from a zip using zip4j. I could find each file in the directory and extract it. How do I list the files inside the directory ? Or, is there a utility to extract the directory to a path ?
jeremyvillalobos
  • 1,795
  • 2
  • 19
  • 39
1
vote
2 answers

zip4j: Does getting the Stream from encrypted file creates a temporary unencrypted staging area?

I have the following code to read an encrypted zip file using zip4j on Android. I do not supply a temporary file. Does zip4j creates a temporary file for decryption ? Or does the zip standard allow for decryption on-the-fly so no encrypted data is…
jeremyvillalobos
  • 1,795
  • 2
  • 19
  • 39
0
votes
1 answer

Got error "inappropriate format" when returning a file inside of a try block

I am trying to create a password-protected zip file using zip4j that contains several files. This is the code I have so far fun createZipFile(filename: String, vararg containers: Pair): ByteArray { val out =…
Patrick
  • 734
  • 11
  • 26
0
votes
0 answers

Password protect zip file with java

I been trying to creat a password protected zip file i come acorss this lirbary net.lingala.zip4j it seems that it use to protect the zip file with password. but now i have been trying all i can do is protect the files not the zip it self, the…
0
votes
1 answer

Unable to zip symlinks that link to directories Zip4j

With Zip4j, I've been able to successfully zip symlinks that link to regular files correctly. However, symlinks that link to directories aren't working for me. Keep in mind that I'm trying to mirror the following shell command from Info-ZIP: zip -yr…
Nold
  • 60
  • 1
  • 7
0
votes
2 answers

Java - AES encrypting a zip file causes it to be corrupted

I am trying to encrypt a zip file with a password using AES-256 encryption. Below is the code that I am running. import java.io.*; import java.security.*; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; import…
xyiong
  • 363
  • 1
  • 10
0
votes
0 answers

what are special characters not allowed to set in net.lingala.zip4j.model.ZipParameters.setFileNameInZip?

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…
0
votes
1 answer

How to add a zipped folder inside an existing zip folder

With the use of createZipReport, I am adding list of files and folders to be zipped up. The createZipReport then calls the zipFileList to zip up the whole folder. The question is I need to zip a folder inside this already existing folder without…
Shiney
  • 1
  • 1
1 2 3
8 9