Here you can find the source of rename_file_to_file(String n1, String n2)
public static boolean rename_file_to_file(String n1, String n2)
//package com.java2s; //License from project: LGPL import java.io.File; public class Main { public static boolean rename_file_to_file(String n1, String n2) { try {//from w w w . ja va 2 s . c o m File f1 = new File(n1); File f2 = new File(n2); return (f1 != null && f2 != null ? f1.renameTo(f2) : false); } catch (SecurityException e) { return false; } } }