Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Copy and Paste folder through Java code

Posted on 2011-02-11
6
Medium Priority
?
803 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

 
LVL 26

Accepted Solution

by:
ksivananth earned 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
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 …
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses

705 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