Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 805
  • Last Modified:

Copy and Paste folder through Java code

I want to copy folder from one path and paste it to another path through Java code for backup purpose. How to do it. Please help
0
Aurii
Asked:
Aurii
  • 2
  • 2
  • 2
1 Solution
 
for_yanCommented:
Do you mean you want to move folder from one location to another?
That can be done recursively, traversing the folder and copying the files.



0
 
ksivananthCommented:
check this example to copy files!

http://www.roseindia.net/java/beginners/CopyFile.shtml
0
 
for_yanCommented:

And this is moving folders from t he same source:
http://www.roseindia.net/java/example/java/io/MovingFile.shtml
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
ksivananthCommented:
here is the complete example copying entire folder by traversing,

http://www.roseindia.net/java/example/java/io/CopyDirectory.shtml
0
 
objectsCommented:
you can use this code to traverse the directory
http://helpdesk.objects.com.au/java/how-to-recursively-traverse-a-directory-tree

far easier to do it from the command line instead of java though
0
 
objectsCommented:
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now