Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java library for zip64

Tags:

java

zip

What is currently the best library to do zip64 with in Java? I need to zip and unzip files / directories larger than 4 GB.

I read that Java 7 has support for zip64. But I guess if I develop for Java 7 this only works if all the computers on which the application will be installed have Java 7 JRE? Is this correct?

At the moment I am using http://sourceforge.net/projects/zip64file/ . But here I was wondering if this is still the best choice? I would like to have a library that supports zipping of directories out of the box. Now I have to do the traversing of the directory structure myself.

like image 433
WillamS Avatar asked Dec 22 '11 09:12

WillamS


People also ask

How do I unzip a Zip file in Java?

To unzip a zip file, we need to read the zip file with ZipInputStream and then read all the ZipEntry one by one. Then use FileOutputStream to write them to file system. We also need to create the output directory if it doesn't exists and any nested directories present in the zip file.

What is Java Util ZIP?

util. zip Description. Provides classes for reading and writing the standard ZIP and GZIP file formats. Also includes classes for compressing and decompressing data using the DEFLATE compression algorithm, which is used by the ZIP and GZIP file formats.

How can I ZIP a file in Java?

Steps to Compress a File in JavaOpen a ZipOutputStream that wraps an OutputStream like FileOutputStream. The ZipOutputStream class implements an output stream filter for writing in the ZIP file format. Put a ZipEntry object by calling the putNextEntry(ZipEntry) method on the ZipOutputStream.

What is Zip4j?

Zip4j is the most comprehensive Java library for zip files or streams.


2 Answers

Also Apache Commons Compress supports Zip64 format.

like image 114
MohamedSanaulla Avatar answered Sep 22 '22 17:09

MohamedSanaulla


Looks like TrueZIP 6.7 Beta has the features you need http://cworld.wikidot.com/development:open-source-java-zip64-library-truezip

  • enables client applications to access ZIP archive transparently as if they were just directories in a file's path name
  • New in TrueZIP 6.7 Beta: The low level ZIP API now supports ZIP64 extensions
  • Runs on J2RE 1.4.2 or higher
like image 36
bpgergo Avatar answered Sep 21 '22 17:09

bpgergo