File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes I/O and Streams and the fly likes How to copy PDF/Ms Word file to another directory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "How to copy PDF/Ms Word file to another directory" Watch "How to copy PDF/Ms Word file to another directory" New topic
Author

How to copy PDF/Ms Word file to another directory

Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 726
Hello,




This code moves the file whereas I am looking for copying the file.
I mean the original file will remain on its place but its copy will be made to other directory. Please note file may be pdf or word any format

Thanks & best regards
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8706
    
    6

Please search before posting. This question comes up all the time and there are many helpful posts like this one


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Harsha Smith
Ranch Hand

Joined: Jul 18, 2011
Posts: 287
Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 726
Thanks from the bottom of my heart

Best regards
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2771
    
  10

Something worth checking out is org.apache.commons.io.FileUtils, and Apache Commons I/O in general. There are lot of useful utility methods there, including ones for copying files on a file system. I like Harsha's example using NIO though.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to copy PDF/Ms Word file to another directory
 
Similar Threads
Problem with FTPClient.retrieveFileStream
Problem in moving file
Cant delete all files in a directory in servlet in NetBeans
java.io.FileNotFoundException
Need help with moving file from one directory to other