This commit is contained in:
laoyuyu
2020-05-25 08:49:44 +08:00
parent e64f3b1240
commit 9a5e491e37
6 changed files with 46 additions and 26 deletions

View File

@@ -291,6 +291,10 @@ final class HttpDFileInfoTask implements IInfoTask, Runnable {
ALog.d(TAG, String.format("文件重命名为:%s", newName));
File oldFile = new File(mEntity.getFilePath());
String newPath = oldFile.getParent() + "/" + newName;
if (!CheckUtil.checkDPathConflicts(false, newPath, mTaskWrapper.getRequestType())) {
ALog.e(TAG, "文件重命名失败");
return;
}
if (oldFile.exists()) {
boolean b = oldFile.renameTo(new File(newPath));
ALog.d(TAG, String.format("文件重命名%s", b ? "成功" : "失败"));