Here you can find the source of renameLocal(String oldPath, String newPath)
public static boolean renameLocal(String oldPath, String newPath)
//package com.java2s; /**//from w ww. j av a 2 s .c om Mybox version 0.1.0 https://github.com/mybox/mybox Copyright (C) 2011 Jono Finger (jono@foodnotblogs.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not it can be found here: http://www.gnu.org/licenses/gpl-2.0.html */ import java.io.*; public class Main { public static boolean renameLocal(String oldPath, String newPath) { System.out.println("Renaming local item " + oldPath + " to " + newPath); File oldFile = new File(oldPath); File newFile = new File(newPath); return (oldFile.renameTo(newFile)); // System.out.println("Error durring rename"); } }