Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

UnZIPPing Exception

 
Ahmed Kotb
Ranch Hand
Posts: 35
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

when trying to UNZIP large ZIP Files i got the Following Exception
java.util.zip.ZipException: invalid entry size (expected 4294967295 but got 4088675440 bytes)
, although my Method Working good with Small files

My Method :


I tried to change the Buffer Size but Still the Same Problem.

So , Any One Can Help Me Please???
 
Mohamed Sanaulla
Saloon Keeper
Posts: 3159
33
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the size of the zip you are trying to unzip? There's some limit on the size of zip you can handle using pre Java 7 Zip APIs, so may be that is the reason you are seeing the exception. I think the data size limit is 4GB. To handle data more than 4GB you need to be using the API which supports Zip64 format and the Java 7 supports it or you can use Apache Commons Compress 1.3 version for zip/unzip
 
Ahmed Kotb
Ranch Hand
Posts: 35
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Size of Zip File is 1.2 GB and after UnZipping 7.8 GB
 
Mohamed Sanaulla
Saloon Keeper
Posts: 3159
33
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ahmed Kotb wrote:Size of Zip File is 1.2 GB and after UnZipping 7.8 GB

I think this is the reason- the unzipped is more than 4GB. Which JDK version are you using?

Try using Apache Commons Compress- The process is exactly similar just that the class names are different- You have ZipArchiveEntry, ZipArchiveInputStream and so on.
 
Ahmed Kotb
Ranch Hand
Posts: 35
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mohamed Sanaulla wrote:
Which JDK version are you using?


I am Using Version "1.6.0_21" of JAVA

Mohamed Sanaulla wrote:
Try using Apache Commons Compress


I am not the Person Who Compress the File , So I have no control on Compressing the File , I just Take the File as it and then deal with it So is there any way in Apache Commons i Can use to Uncompress the File??
 
Mohamed Sanaulla
Saloon Keeper
Posts: 3159
33
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah you can use Apache Commons Compress API to unzip. So you can give it a try, you just have to download the jar and add it to the classpath.
 
Ahmed Kotb
Ranch Hand
Posts: 35
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mohamed Sanaulla wrote:
Yeah you can use Apache Commons Compress API to unzip


So Please can you tell me The Jar Name and the Link I can download from it.
 
Ahmed Kotb
Ranch Hand
Posts: 35
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Mohamed Sanaulla I tried Apache Commons Library and it works Fine.
 
Mohamed Sanaulla
Saloon Keeper
Posts: 3159
33
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Glad that you got it working.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic