Java tutorial
//package com.java2s; import java.io.File; public class Main { public static boolean renameFile(String src, String dst) { File srcFile = new File(src); File dstFile = new File(dst); if (dstFile.exists()) { dstFile.delete(); } return srcFile.renameTo(dstFile); } }