mukundhansuresh
asked on
Java code to zip the any formatted files and copy them to a local directory
Hi,
I have got a list of .pdf or any formatted files that will be placed in a directory. I need a java program to look for this directory, get the files, zip them into a single zip and copy it to a local directory.
eg.
C:\file1.pdf
C:\File2.pdf
C:\File3.txt
ZIp them all to files.zip and copy them to D:\
Thanks
I have got a list of .pdf or any formatted files that will be placed in a directory. I need a java program to look for this directory, get the files, zip them into a single zip and copy it to a local directory.
eg.
C:\file1.pdf
C:\File2.pdf
C:\File3.txt
ZIp them all to files.zip and copy them to D:\
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks. It works perfect
(1) Traverse through each directory within the root drive, and check each directory for the files.
(2) If file is found, copy it to a temp folder.
(3) Once all folders have been searched, turn the temp folder into a ZIP (example: http://javaalmanac.com/egs/java.util.zip/CreateZip.html)
Try each stage, one by one, and let us know which one you're having trouble with.
I for one am pretty reluctant to just code the solution for you.
[We're here to help you learn, not to provide solutions that you could pay for on rentacoder.com..]
:)