Here you can find the source of renameAs(String pathDir, String name, String wishName)
public static boolean renameAs(String pathDir, String name, String wishName)
//package com.java2s; import java.io.File; public class Main { public static boolean renameAs(String pathDir, String name, String wishName) {/*from w w w .j av a 2 s. co m*/ if (pathDir != null & name != null & wishName != null) { File arch = new File(pathDir + "/" + name); File newArch = new File(pathDir + "/" + wishName); arch.renameTo(newArch); return true; } return false; } }