aspose file tools*
The moose likes Java in General and the fly likes UnZIPPing Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "UnZIPPing Exception" Watch "UnZIPPing Exception" New topic
Author

UnZIPPing Exception

Ahmed Kotb
Ranch Hand

Joined: Apr 29, 2011
Posts: 35

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???


Ahmed Kotb
Software Developer
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3071
    
  33

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


Mohamed Sanaulla | My Blog
Ahmed Kotb
Ranch Hand

Joined: Apr 29, 2011
Posts: 35

Size of Zip File is 1.2 GB and after UnZipping 7.8 GB
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3071
    
  33

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

Joined: Apr 29, 2011
Posts: 35

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

Joined: Sep 08, 2007
Posts: 3071
    
  33

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

Joined: Apr 29, 2011
Posts: 35

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

Joined: Apr 29, 2011
Posts: 35

Thanks Mohamed Sanaulla I tried Apache Commons Library and it works Fine.
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3071
    
  33

Glad that you got it working.
 
Don't get me started about those stupid light bulbs.
 
subject: UnZIPPing Exception