Hmmm, reading all the responses to that article I'd be a bit shy about using it. Usually the answer is you're on your own to read the old file and write the new one. If you have to copy directories you need to detect the source directory and create the target directory. To copy bytes without corruption, use some streams for the job. Take a look at the JavaDoc, see if you can find classes that look appropriate. Give it a shot and let us see what you come up with!
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
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
Joined: Dec 29, 2004
For that article I posted, if you are sure you will be moving files around on the same file system (not crossing partitions, ect...) the renameTo() function is fine. Otherwise I've heard the apache IOUtils mentioned above are very nice (although I haven't used them).
Joined: Jan 07, 2005
Great thanks for all responses. Will try the apache IOUtils.