Here you can find the source of rename(String was_name, String new_name)
public static boolean rename(String was_name, String new_name)
//package com.java2s; //License from project: Open Source License import java.io.*; public class Main { public static boolean rename(String was_name, String new_name) { File was_file = new File(was_name); File new_file = new File(new_name); System.err.println(/*from w w w .j a v a 2 s . c o m*/ "[IOUtils] renaming: " + was_file.getAbsolutePath() + " to: " + new_file.getAbsolutePath()); return was_file.renameTo(new_file); } }