From 392b7312342434faf9fc52791bf5734202de0e9d Mon Sep 17 00:00:00 2001 From: "sigonasr2, Sig, Sigo" Date: Tue, 12 Jul 2022 19:01:47 +0000 Subject: [PATCH] Detect plugin files Co-authored-by: sigonasr2 --- plugins/TestPlugin.java | 3 +++ src/sig/PluginLoader.java | 16 ++++++++++++++++ src/sig/SigsUniverse.java | 2 +- 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 plugins/TestPlugin.java diff --git a/plugins/TestPlugin.java b/plugins/TestPlugin.java new file mode 100644 index 0000000..2242da1 --- /dev/null +++ b/plugins/TestPlugin.java @@ -0,0 +1,3 @@ +public class TestPlugin { + +} diff --git a/src/sig/PluginLoader.java b/src/sig/PluginLoader.java index e69de29..c4d8ef2 100644 --- a/src/sig/PluginLoader.java +++ b/src/sig/PluginLoader.java @@ -0,0 +1,16 @@ +package sig; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; + +public class PluginLoader { + public static void LoadPlugins() { + Path p = Path.of("..","plugins"); + try { + Files.walk(p).filter((f)->Files.isRegularFile(f)).forEach((f)->{System.out.println("Found "+f);}); + } catch (IOException e) { + e.printStackTrace(); + } + } +} diff --git a/src/sig/SigsUniverse.java b/src/sig/SigsUniverse.java index d90ad2a..e3db9b2 100644 --- a/src/sig/SigsUniverse.java +++ b/src/sig/SigsUniverse.java @@ -2,6 +2,6 @@ package sig; public class SigsUniverse { public static void main(String[] args) { - System.out.println("Hello World!"); + PluginLoader.LoadPlugins(); } }