Solved

Copy and Paste folder through Java code

Posted on 2011-02-11
6
774 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

910 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now