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

Method autoRenameFile

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

重命名文件或文件夹 自动路径 jar启动时使用外部路径 IDE启动时使用内部路径 @param resFilePath 源文件路径 @param newFileName 重命名 @return 操作成功标识

(String resFilePath, String newFileName)

Source from the content-addressed store, hash-verified

664 * @return 操作成功标识
665 */
666 public static boolean autoRenameFile(String resFilePath, String newFileName) {
667 File resFile = new File(PathUtil.autoRootPath()+File.separator+resFilePath);
668 //源文件父路径
669 String resParentPath = resFile.getParent();
670 File newFile = new File(resParentPath+File.separator+newFileName);
671 return resFile.renameTo(newFile);
672 }
673}

Callers

nothing calls this directly

Calls 1

autoRootPathMethod · 0.95

Tested by

no test coverage detected