• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
  • paul wheaton
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Rob Spoor
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:

Exception

 
Ranch Hand
Posts: 35
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

When trying to extract ZIP file , encountered the following Exception [java.util.zip.ZipException : invalid block type]

Can anyone help please?
 
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I believe your file is corrupted.
 
Ahmed Kotb
Ranch Hand
Posts: 35
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
no File is not corrupted , i tried to extract it with winrare and it is extracted successfully
 
author
Posts: 23942
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ahmed Kotb wrote:no File is not corrupted , i tried to extract it with winrare and it is extracted successfully



WinRar supports many many different formats -- including the copyrighted rar format. If the cause is because you are using a format that isn't support, I don't know what to tell you.

Henry
 
Ahmed Kotb
Ranch Hand
Posts: 35
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
to be with me this is the code i use

 
Ahmed Kotb
Ranch Hand
Posts: 35
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Henry Wong wrote:
WinRar supports many many different formats -- including the copyrighted rar format. If the cause is because you are using a format that isn't support, I don't know what to tell you.





File Format is ZIP , and after extraction i try to rename it as above in the code.

I used this method with Small files and it worked good , but when dealing with large files it throws that exception.
 
Sheriff
Posts: 22769
130
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How large is "large"? If I remember correctly, Java's ZIP classes didn't support ZIP files of 4GB or larger until Java 7.
 
Ahmed Kotb
Ranch Hand
Posts: 35
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
when downloading that file with FileZilla the extraction method working well, so i guess that the problem in the method which i am using for downloading(retrieveFile(String remoteFileName, FileOutputStream fos)) ...
I am using Apache Library (commons-net.jar), is there any problems for that library ?
 
Ahmed Kotb
Ranch Hand
Posts: 35
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks to All

I found the Error

The Error was in Setting File Type Before Downloading it .
 
Rob Spoor
Sheriff
Posts: 22769
130
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ah yes, the dreaded ASCII / binary download problem. Downloading a binary file (like ZIP files) as if they were text will corrupt the file. That's what happened to you. When using binary or automatic for transferring you won't have this problem.
 
Did Steve tell you that? Fuh - Steve. Just look at this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic