重命名文件或文件夹 自动路径 jar启动时使用外部路径 IDE启动时使用内部路径 @param resFilePath 源文件路径 @param newFileName 重命名 @return 操作成功标识
(String resFilePath, String newFileName)
| 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 | } |
nothing calls this directly
no test coverage detected