java 修改文件名
// 修改文件名 public static boolean modifyFileName(String serverPath, String oldFileName, String newLoginNo) { String oldPath = serverPath + "/" + oldFileName; String newPath = serverPath + "/" + newLoginNo + "-" + oldFileName.substring(oldFileName.indexOf('-') + 1); File oldFile = new File(oldPath); File newFile = new File(newPath); if (oldFile.renameTo(newFile)) { return true; } else { return false; } }
posted on 2014-10-23 16:23 hellofking 阅读(317) 评论(0) 收藏 举报
浙公网安备 33010602011771号