mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix FileUtil.remove bug
This commit is contained in:
@@ -1175,7 +1175,10 @@ public class FileUtil {
|
||||
*/
|
||||
public static File rename(File file, String newName, boolean isRetainExt, boolean isOverride) {
|
||||
if (isRetainExt) {
|
||||
newName = newName.concat(".").concat(FileUtil.extName(file));
|
||||
final String extName = FileUtil.extName(file);
|
||||
if(StrUtil.isNotBlank(extName)){
|
||||
newName = newName.concat(".").concat(extName);
|
||||
}
|
||||
}
|
||||
final Path path = file.toPath();
|
||||
final CopyOption[] options = isOverride ? new CopyOption[]{StandardCopyOption.REPLACE_EXISTING} : new CopyOption[]{};
|
||||
|
Reference in New Issue
Block a user