Hi, I need to write some code to copy all the contents(including sub directories and files) of one directory to another directory. I've tried using File.renameTo(), but, this method 'moves' the contents rather than copying them. Can some one please point me to a good algorithm of iterating thru the contents of a directory, and copying them to another? Thanks a lot. -Asuthosh.
posted 15 years ago
If there are a limited number of O/S that you need to run this on, you would probably be better making a call to the operating system commands using Runtime.exec()