Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Directory copying

 
ramu taraka
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.)
 
Kaydell Leavitt
Ranch Hand
Posts: 689
Eclipse IDE Firefox Browser Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15357
39
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or use a non-standard API: http://jakarta.apache.org/commons/io/
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic