From 6daabf1f4794e0fec6f4d2e14faf46809a3d792d Mon Sep 17 00:00:00 2001 From: HaHaWTH Date: Sun, 10 Mar 2024 16:00:02 +0800 Subject: [PATCH] Use nio --- src/main/java/io/wdsj/asw/method/ExternalWordAllow.java | 3 ++- src/main/java/io/wdsj/asw/method/ExternalWordDeny.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/wdsj/asw/method/ExternalWordAllow.java b/src/main/java/io/wdsj/asw/method/ExternalWordAllow.java index f160694..f4ed5dc 100644 --- a/src/main/java/io/wdsj/asw/method/ExternalWordAllow.java +++ b/src/main/java/io/wdsj/asw/method/ExternalWordAllow.java @@ -8,13 +8,14 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; +import java.nio.file.Paths; import java.util.Collections; import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; public class ExternalWordAllow implements IWordAllow { - private final File dataFolder = new File(AdvancedSensitiveWords.getInstance().getDataFolder(), "/external/allow"); + private final File dataFolder = Paths.get(AdvancedSensitiveWords.getInstance().getDataFolder().getPath(),"external","allow").toFile(); @Override public List allow() { diff --git a/src/main/java/io/wdsj/asw/method/ExternalWordDeny.java b/src/main/java/io/wdsj/asw/method/ExternalWordDeny.java index 330bb82..6a14575 100644 --- a/src/main/java/io/wdsj/asw/method/ExternalWordDeny.java +++ b/src/main/java/io/wdsj/asw/method/ExternalWordDeny.java @@ -8,13 +8,14 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; +import java.nio.file.Paths; import java.util.Collections; import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; public class ExternalWordDeny implements IWordDeny { - private final File dataFolder = new File(AdvancedSensitiveWords.getInstance().getDataFolder(), "/external/deny"); + private final File dataFolder = Paths.get(AdvancedSensitiveWords.getInstance().getDataFolder().getPath(),"external","deny").toFile(); @Override public List deny() {