重命名文件或文件夹 @param resFilePath 源文件路径 @param newFileName 重命名 @return 操作成功标识
(String resFilePath, String newFileName)
| 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 | * |
nothing calls this directly
no test coverage detected