Link to home
Start Free TrialLog in
Avatar of mukundhansuresh
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
Avatar of InteractiveMind
InteractiveMind
Flag of United Kingdom of Great Britain and Northern Ireland image

What problem are you having with this exactly?

(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..]

:)
ASKER CERTIFIED SOLUTION
Avatar of mukundha_expert
mukundha_expert

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mukundhansuresh
mukundhansuresh

ASKER

Thanks. It works perfect