mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
fix bug
This commit is contained in:
parent
dd560ce5e3
commit
91e2eabd04
@ -3,7 +3,7 @@
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
# 5.7.20 (2022-01-16)
|
||||
# 5.7.20 (2022-01-17)
|
||||
|
||||
### 🐣新特性
|
||||
* 【core 】 增加对null值友好的groupingBy操作的Collector实现,可指定map类型(pr#498@Gitee)
|
||||
@ -23,6 +23,7 @@
|
||||
* 【core 】 修复CustomKeyMap的merge失效问题(issue#2086@Github)
|
||||
* 【core 】 修复FileUtil.appendLines换行问题(issue#I4QCEZ@Gitee)
|
||||
* 【core 】 修复java.time.Month解析问题(issue#2090@Github)
|
||||
* 【core 】 修复PathUtil.moveContent移动覆盖导致的问题(issue#I4QV0L@Gitee)
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
# 5.7.19 (2022-01-07)
|
||||
|
@ -20,6 +20,7 @@ import java.nio.charset.Charset;
|
||||
import java.nio.file.AccessDeniedException;
|
||||
import java.nio.file.CopyOption;
|
||||
import java.nio.file.DirectoryStream;
|
||||
import java.nio.file.FileAlreadyExistsException;
|
||||
import java.nio.file.FileVisitOption;
|
||||
import java.nio.file.FileVisitResult;
|
||||
import java.nio.file.FileVisitor;
|
||||
@ -516,6 +517,11 @@ public class PathUtil {
|
||||
try {
|
||||
return Files.move(src, target, options);
|
||||
} catch (IOException e) {
|
||||
if(e instanceof FileAlreadyExistsException){
|
||||
// 目标文件已存在,直接抛出异常
|
||||
// issue#I4QV0L@Gitee
|
||||
throw new IORuntimeException(e);
|
||||
}
|
||||
// 移动失败,可能是跨分区移动导致的,采用递归移动方式
|
||||
try {
|
||||
Files.walkFileTree(src, new MoveVisitor(src, target, options));
|
||||
|
Loading…
x
Reference in New Issue
Block a user