I am curious if anyone has any code for a class that will extract zip
files from folders and place the extracted files in a folder of the
same name on a different hard drive.
For instance, I have a folder called 1998. Within that folder are 60
subfolders, each containing a zip file that contains reports generated
for that day. I would like use a java class in the form of an exe to
loop through all of these subfolders, extract the information in the
zip files, and place the extracted files into a folder of the same
name on a different drive.
I know about the UnZip.java class, I'm just wondering if anyone has a
solution to the situation I mentioned above. I'm stumped. Will someone
please figure out this difficult problem for free and in their spare
time? Thank you.
Christophe Vanfleteren - 29 Apr 2004 20:00 GMT
> I am curious if anyone has any code for a class that will extract zip
> files from folders and place the extracted files in a folder of the
[quoted text clipped - 11 lines]
> please figure out this difficult problem for free and in their spare
> time? Thank you.
This is not a difficult problem. You should be able to work this out for
yourself using
http://java.sun.com/j2se/1.4.2/docs/api/java/util/zip/ZipFile.html
and
http://java.sun.com/j2se/1.4.2/docs/api/java/io/File.html
Just coming in here asking someone to do your work for you for free will not
work. Why don't you use your spare time to learn some Java instead?

Signature
Kind regards,
Christophe Vanfleteren
martim07 - 30 Apr 2004 02:56 GMT
> > I am curious if anyone has any code for a class that will extract zip
> > files from folders and place the extracted files in a folder of the
[quoted text clipped - 21 lines]
> Just coming in here asking someone to do your work for you for free will not
> work. Why don't you use your spare time to learn some Java instead?
I was being sarcastic, Christophe. I don't expect anyone to write a
class for me. Thanks for your input.
Roedy Green - 29 Apr 2004 22:28 GMT
>I am curious if anyone has any code for a class that will extract zip
>files from folders and place the extracted files in a folder of the
>same name on a different hard drive.
the key is to use a Filter to find the zips. see
http://mindprod.com/jgloss/filter.html
The use open with Zip and extract each element as a set of raw bytes,
and save them with FileOutputStream buffered.
See http://mindprod.com/fileio.htm for sample code.
See http://mindprod.com/products.html#FILETRANSFER
for classes that do what you want, only without zip.
they may be helpful models. You need to do the io in large chunks for
speed. This contains the obvious chunking logic to deal with fixed
size chunks and the leftover.
--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.