dcsimg

How can I rename a file?

John Zukowski

The File class has a renameTo() method that allows you to rename files, just pass in an argument of the new name as a File object. A boolean status is returned to report success or failure.