Java tutorial
//package com.java2s; import java.io.File; public class Main { static public boolean renameFile(File file, File new_name) { boolean result; if (file != null && file.exists() && file.renameTo(new_name)) { result = true; } else { result = false; } return result; } }