MCPcopy Create free account
hub / github.com/diyhi/bbs / renameFile

Method renameFile

src/main/java/cms/utils/FileUtil.java:414–420  ·  view source on GitHub ↗

重命名文件或文件夹 @param resFilePath 源文件路径 @param newFileName 重命名 @return 操作成功标识

(String resFilePath, String newFileName)

Source from the content-addressed store, hash-verified

412 * @return 操作成功标识
413 */
414 public static boolean renameFile(String resFilePath, String newFileName) {
415 File resFile = new File(PathUtil.defaultExternalDirectory()+File.separator+resFilePath);
416 //源文件父路径
417 String resParentPath = resFile.getParent();
418 File newFile = new File(resParentPath+File.separator+newFileName);
419 return resFile.renameTo(newFile);
420 }
421 /**
422 * 重命名文件夹
423 *

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected