refactor: 使用 CharSequenceUtil 替换部分 StrUtil 使用以解决 Sonar 问题

This commit is contained in:
2025-07-20 08:45:24 +08:00
parent 35e79620e4
commit ddd4e38dca
7 changed files with 22 additions and 23 deletions

View File

@@ -19,8 +19,8 @@ package top.continew.starter.storage.strategy;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.io.IoUtil;
import cn.hutool.core.io.file.FileNameUtil;
import cn.hutool.core.text.CharSequenceUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.digest.DigestUtil;
import top.continew.starter.core.constant.StringConstants;
import top.continew.starter.core.exception.BusinessException;
@@ -123,7 +123,7 @@ public class LocalStorageStrategy implements StorageStrategy<LocalClient> {
// 格式化文件名 防止上传后重复
String formatFileName = StorageUtils.formatFileName(fileName);
// 判断文件路径是否为空 为空给默认路径 格式 2024/12/30/
if (StrUtil.isEmpty(path)) {
if (CharSequenceUtil.isEmpty(path)) {
path = StorageUtils.localDefaultPath();
}
// 判断文件夹是否存在 不存在则创建