refactor: 根据 Sonar 建议调整,StrUtil => CharSequenceUtil

工具层调整以减少 Sonar 建议,应用层则可忽略,怎么用方便怎么来
This commit is contained in:
2024-02-07 17:48:32 +08:00
parent 00bba33517
commit ea71cf573b
26 changed files with 117 additions and 114 deletions

View File

@@ -16,7 +16,7 @@
package top.charles7c.continew.starter.storage.local.autoconfigure;
import cn.hutool.core.util.StrUtil;
import cn.hutool.core.text.CharSequenceUtil;
import jakarta.annotation.PostConstruct;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -57,10 +57,10 @@ public class LocalStorageAutoConfiguration implements WebMvcConfigurer {
LocalStorageProperties.LocalStorageMapping mapping = mappingEntry.getValue();
String pathPattern = mapping.getPathPattern();
String location = mapping.getLocation();
if (StrUtil.isBlank(location)) {
if (CharSequenceUtil.isBlank(location)) {
throw new IllegalArgumentException(String.format("Path pattern [%s] location is null.", pathPattern));
}
registry.addResourceHandler(StrUtil.appendIfMissing(pathPattern, StringConstants.PATH_PATTERN))
registry.addResourceHandler(CharSequenceUtil.appendIfMissing(pathPattern, StringConstants.PATH_PATTERN))
.addResourceLocations(!location.startsWith("file:")
? String.format("file:%s", this.format(location))
: this.format(location))