Alex Rivera | Logout

Zip files with Java: Is there a limit?

Asked 2011-07-18T20:07:34.970
15

I'm creating a backup routine for my application with Java. However, when the zip file is over 4GB, or has more than 65,000 files (approximately), the zip file is corrupted.

I'm also testing the Apache Commons Compression for compacting to tar.gz, but it has file name limit of 100 characters. I was wanting to test this API compressing to zip, but I wonder what exactly is the problem with the java zip.

So, the real question is: I'm doing something wrong, it is limit of Java Zip implementation, or is the limit for the Zip format itself?

Thanks.

Edit
Report

1 Answer

5

It's a bug that's reported fixed in Java 7: https://bugs.java.com/bugdatabase/view_bug?bug_id=4681995

One of the commenters on that tickets mentions TrueZIP as a workaround.

answered 2011-07-18T20:15:02.467

Your Answer