Here you can find the source of rename(String oldFile, String newFile)
public static boolean rename(String oldFile, String newFile)
//package com.java2s; /*/*w ww. ja v a 2 s. c o m*/ * Copyright 2010-2011, Sikuli.org * Released under the MIT License. * */ import java.io.*; public class Main { public static boolean rename(String oldFile, String newFile) { File old = new File(oldFile); return old.renameTo(new File(newFile)); } }