• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Java.util.zip question

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've pasted my code below. I'm kind of getting the output I want.
What I'm looking to do is get only the final directory in the zip file...not the whole path.

--CreateZipFile.java---
--ZipStructure.java---
Is there any help you give? I'm lost....

thanks.
 
Bartender
Posts: 7488
171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is a really bad idea when I/O is involved:

You simply must handle the exception, at the least, print the stack trace to where you will see it.
 
Joe Chorba
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I agree, I intend to add the printstacktrace in there, I'm trying to figure out why I'm getting absolute path in my zip file instead of just the file folder...

I can't figure out what I'm missing...I'm not getting any errors. It's not entering the catch, so there is nothing that it would print out anyway.

The other issue I'm having is that if a folder in the final path is empty, it doesn't copy the folder. How do I get it to copy ALL the folders?
 
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Similar topic was discussed recently here, maybe it could help you.
 
Joe Chorba
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Martin Vajsar wrote:Similar topic was discussed recently here, maybe it could help you.



Thanks. I actually got it so that now it's taking only the final folder...however, I still cannot get the empty folders.
reply
    Bookmark Topic Watch Topic
  • New Topic