Search code examples
javafilestrutsrename

How to rename an existing file


I have an existing file in my HDD and I want rename this file.


Solution

  • Like this:

    new File(path).renameTo(new File(newPath));