This commit is contained in:
Looly
2020-06-05 17:59:00 +08:00
parent d4ee12562b
commit 94335d176b
10 changed files with 2123 additions and 13 deletions

View File

@@ -20,8 +20,6 @@ import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.CharsetUtil;
import cn.hutool.core.util.ReflectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.log.Log;
import cn.hutool.log.LogFactory;
import cn.hutool.log.StaticLog;
import cn.hutool.setting.SettingRuntimeException;
@@ -46,7 +44,6 @@ import java.util.Properties;
*/
public final class Props extends Properties implements BasicTypeGetter<String>, OptBasicTypeGetter<String> {
private static final long serialVersionUID = 1935981579709590740L;
private final static Log log = LogFactory.get();
/**
* 默认配置文件扩展名
@@ -257,11 +254,11 @@ public final class Props extends Properties implements BasicTypeGetter<String>,
if (null == this.propertiesFileUrl) {
throw new SettingRuntimeException("Can not find properties file: [{}]", urlResource);
}
log.debug("Load properties [{}]", propertiesFileUrl.getPath());
try (final BufferedReader reader = urlResource.getReader(charset)) {
super.load(reader);
} catch (Exception e) {
log.error(e, "Load properties error!");
} catch (IOException e) {
throw new IORuntimeException(e);
}
}