This commit is contained in:
Looly
2023-12-29 20:55:55 +08:00
parent 91178e45a8
commit 6facfcfc4d
101 changed files with 271 additions and 307 deletions

View File

@@ -214,6 +214,8 @@ public class Setting extends AbsSetting implements Map<String, String> {
// 先关闭之前的监听
IoUtil.closeQuietly(this.watchMonitor);
this.watchMonitor = WatchUtil.ofModify(resource.getUrl(), new SimpleWatcher() {
private static final long serialVersionUID = 5190107321461226190L;
@Override
public void onModify(final WatchEvent<?> event, final WatchKey key) {
final boolean success = load();

View File

@@ -231,6 +231,8 @@ public final class Props extends Properties implements TypeGetter<CharSequence>
// 先关闭之前的监听
IoUtil.closeQuietly(this.watchMonitor);
this.watchMonitor = WatchUtil.ofModify(this.resource.getUrl(), new SimpleWatcher() {
private static final long serialVersionUID = 1L;
@Override
public void onModify(final WatchEvent<?> event, final WatchKey key) {
load();

View File

@@ -15,6 +15,7 @@ package org.dromara.hutool.setting.toml;
import org.dromara.hutool.core.array.ArrayUtil;
import org.dromara.hutool.core.io.IORuntimeException;
import org.dromara.hutool.core.text.CharUtil;
import org.dromara.hutool.core.text.StrUtil;
import org.dromara.hutool.setting.SettingException;
import java.io.IOException;
@@ -199,7 +200,7 @@ public class TomlWriter {
indent();
writeKey(name);
write(" = ");
writeString(ArrayUtil.toString(array));
writeString(StrUtil.emptyIfNull(ArrayUtil.toString(array)));
}
} else if (value instanceof Map) {// table
if (simpleValues) {

View File

@@ -13,7 +13,6 @@
package org.dromara.hutool.setting.toml;
import org.dromara.hutool.core.io.resource.ResourceUtil;
import org.dromara.hutool.core.lang.Console;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;