
Signature
Simplicity is the ultimate sophistication.
-- Leonardo da Vinci
On Apr 25, 11:09 am, Leonard Milcin <leon...@milcin.dont-spam.pl>
wrote:
> > I'm trying to extract a ZIP file to a temporary directory
> > (System.getProperty("java.io.tmpdir")) and I keep getting the
[quoted text clipped - 34 lines]
> Simplicity is the ultimate sophistication.
> -- Leonardo da Vinci
Actually, the issue was not as simple as what you suggested.
The problem is, I'm attempting to unzip a ZIP file. I'm following the
tutorial found here: http://java.sun.com/developer/technicalArticles/Programming/compression/
and it works, except when there is a "path" value associated with the
entry.
This is what's causing the sticking point, and I'm not really sure how
to handle it. I suppose I could parse the file name off the end of
the path (which I get through entry.getName()) and then create the
files using File.mkdirs(), but that seems too roundabout.
Is there something I'm missing at this point? Like I said - it works
when there is no path value associated with the ZIP file.
Thanks
Leonard Milcin - 25 Apr 2008 16:42 GMT
> Actually, the issue was not as simple as what you suggested.
>
[quoted text clipped - 7 lines]
> the path (which I get through entry.getName()) and then create the
> files using File.mkdirs(), but that seems too roundabout.
You can't create file in a directory that doesn't exist. It has to be
created before you can create a file in it. File.mkdirs() is simplest
and for most cases best way to do it. And you can use File to parse
abstract paths (eg. to get the name of directory to be created).
> Is there something I'm missing at this point? Like I said - it works
> when there is no path value associated with the ZIP file.
Because, then, you create the file in current directory.
Regards,
Leonard

Signature
Simplicity is the ultimate sophistication.
-- Leonardo da Vinci