aspose file tools*
The moose likes Beginning Java and the fly likes Directory copying Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Directory copying" Watch "Directory copying" New topic
Author

Directory copying

ramu taraka
Greenhorn

Joined: May 20, 2007
Posts: 11
The requriement of my project is we need to copy the contents of one dir to anthor directory. How we can do this in Java...

Please help me and its very urgent.......
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Moved from SCJP to here begause it's ugent. I guess that once we see an attempt at solving the problem yourself you will likely get some help...

Or you can try our consultancy service


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Originally posted by ramu taraka:
... Please help me and its very urgent.......

Hope I'm not too late. The answer is java.io.File. Glad I could help.

(Seriously, see what you can do using this class. If you have specific problems, post back with details.)


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Kaydell Leavitt
Ranch Hand

Joined: Nov 18, 2006
Posts: 689

marc,

For copying and deleting whole directories, is there no utility method in the standard API that does this?

Do you have to use FileUtils at Apache Commons or some other third-party solution?

Kaydell
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14113
    
  16

No, there is no utility method in the standard API to do this.

Have a look at this: The Java Developers Almanac - Copying a Directory


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Or use a non-standard API: http://jakarta.apache.org/commons/io/


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
 
wood burning stoves
 
subject: Directory copying