File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Windows does not recognize Java created ZIP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Windows does not recognize Java created ZIP" Watch "Windows does not recognize Java created ZIP" New topic
Author

Windows does not recognize Java created ZIP

David Cheung
Greenhorn

Joined: Jul 31, 2009
Posts: 10
I'm using java.util.zip to zip up some files, following some examples on the web (ZipOutputStream, ZipEntry, etc.)



Now, the created ZIP file appears to be valid, but when I use Windows to list the contents, it's empty! But when I use the third-party WinZip application, it sees the files without problem.

I've tried googling to see if this is a known problem, but I've come up with nothing, so I must be doing something wrong? Any help is appreciated!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39529
    
  27
so I must be doing something wrong?

Why? One might as well conclude that Windows is doing something wrong


Ping & DNS - updated with new look and Ping home screen widget
David Cheung
Greenhorn

Joined: Jul 31, 2009
Posts: 10
Actually, it turned out I *WAS* doing something wrong

When I create the new ZipEntry(String name), I gave it the absolute path of the file. Apparently this is not valid (for Windows. anyway)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Windows does not recognize Java created ZIP
 
Similar Threads
how to put two different folders(which is in different location) into one zip entry
Tomcat cannot unzip a War file
java.util.zip : Unzipping gives Windows error
Java ZipFile
Compress .zip using Java