aspose file tools*
The moose likes Java in General and the fly likes What can be the problem cause ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "What can be the problem cause ?" Watch "What can be the problem cause ?" New topic
Author

What can be the problem cause ?

Muhammad Asif
Ranch Hand

Joined: Jul 13, 2001
Posts: 202
Hi All,
I am trying to Extract a zip file!
When I try to open the file using
ZipFile zFile = new ZipFile(zipFile);
i get the following exception :
java.util.zip.ZipException: error in opening zip file
java.lang.Throwable(java.lang.String)
java.lang.Exception(java.lang.String)
java.io.IOException(java.lang.String)
java.util.zip.ZipException (java.lang.String)
long java.util.zip.ZipFile.open(java.lang.String)
java.util.zip.ZipFile(java.lang.String)
java.util.zip.ZipFile(java.io.File)
Can some one figure out the problem ???
And one more thing,
I am able to open the zip file using WinZip without ne problems!
Regards
Muhammad Asif Abbasi


SCJP, SCBCD, SCWCD 1.4, IBM-OOAD, SCEA, TCP, TCSS, TCIS, ATCP
Karl Laird
Ranch Hand

Joined: Jul 14, 2001
Posts: 67
The unfortunate problem here is that java Zip is incompatible with regular Zip algorithms.
You can only open Zip files that have been made by a java Zip file writer - not Winzip archives.
Hopefully this will be corrected in a later version of the JDK


The Eagle sneers at the Peacock<p>Systems Administrator<br />OrderWare Solutions Ltd<br /><a href="http://www.orderware.net" target="_blank" rel="nofollow">http://www.orderware.net</a>
Snigdha Solanki
Ranch Hand

Joined: Sep 07, 2000
Posts: 128
Which version of JDK are you using? In JDK 1.3 it
is possible to open zip files which are created using Winzip or any other archiving tool. I am not sure about older versions but your program should work fine on JDK1.3.


Snigdha<br />Sun Certified Programmer for the Java™ 2 Platform
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What can be the problem cause ?