 <p>You could also use the <a href="http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/io/Files.html#move%28java.io.File,%20java.io.File%29" rel="nofollow"><code>Files.move</code></a> utility from Google Guava libraries to rename a file. Its easier than writing your own method.</p> <p>From the docs:</p> <blockquote> <p>Moves the file from one path to another. This method can rename a file or move it to a different directory, like the Unix mv command.</p> </blockquote>