Win a copy of Java Persistence with Spring Data and Hibernate this week in the Spring forum!
  • 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
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

Windows does not recognize Java created ZIP

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Rancher
Posts: 43075
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

so I must be doing something wrong?


Why? One might as well conclude that Windows is doing something wrong
 
David Cheung
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)
 
Whip out those weird instruments of science and probe away! I think it's a tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic