Solved

Copy and Paste folder through Java code

Posted on 2011-02-11
6
790 Views
Last Modified: 2012-05-11
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
Comment
Question by:Aurii
  • 2
  • 2
  • 2
6 Comments
 
LVL 47

Expert Comment

by:for_yan
ID: 34868989
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
 
LVL 26

Expert Comment

by:ksivananth
ID: 34869003
check this example to copy files!

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

Expert Comment

by:for_yan
ID: 34869009

And this is moving folders from t he same source:
http://www.roseindia.net/java/example/java/io/MovingFile.shtml
0
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
LVL 26

Accepted Solution

by:
ksivananth earned 500 total points
ID: 34869010
here is the complete example copying entire folder by traversing,

http://www.roseindia.net/java/example/java/io/CopyDirectory.shtml
0
 
LVL 92

Expert Comment

by:objects
ID: 34869364
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
 
LVL 92

Expert Comment

by:objects
ID: 34869384
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to convert from xls to xlsx using java 7 57
going to wrong jsp page 2 34
IBM TS2900 (3572) Tape Autoloader Java? 12 19
Coding for the first time 9 37
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question