diff options
author | axtloss <axtlos@getcryst.al> | 2023-05-31 20:54:55 +0200 |
---|---|---|
committer | axtloss <axtlos@getcryst.al> | 2023-05-31 20:54:55 +0200 |
commit | 3999be65f43c30d22c93e28c8f1554c923973d23 (patch) | |
tree | 884c99b032e2fcd66960cc6c10395ae08e5ee7cf /src/main/java/io/github/jshipit/ConfigParser.java | |
parent | 3bfe8ba05a429e726001b88c63f736f1bbed3509 (diff) | |
download | jshipit-3999be65f43c30d22c93e28c8f1554c923973d23.tar.gz jshipit-3999be65f43c30d22c93e28c8f1554c923973d23.tar.bz2 |
Add permissions configuration file
Diffstat (limited to 'src/main/java/io/github/jshipit/ConfigParser.java')
-rw-r--r-- | src/main/java/io/github/jshipit/ConfigParser.java | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/main/java/io/github/jshipit/ConfigParser.java b/src/main/java/io/github/jshipit/ConfigParser.java new file mode 100644 index 0000000..0b19acd --- /dev/null +++ b/src/main/java/io/github/jshipit/ConfigParser.java @@ -0,0 +1,45 @@ +package io.github.jshipit; + +import com.moandjiezana.toml.Toml; + +import java.io.File; +import java.util.List; + +public class ConfigParser { + public String configPath; + + public ConfigParser(String configPath) { + this.configPath = configPath; + } + + public void parseConfig() { + System.out.println("Parsing config"); + Toml toml = new Toml().read(new File(this.configPath)); + } + + public String getString(String key) { + Toml toml = new Toml().read(new File(this.configPath)); + return toml.getString(key); + } + + public boolean getBoolean(String key) { + Toml toml = new Toml().read(new File(this.configPath)); + return toml.getBoolean(key); + } + + public List<String> getList(String key) { + Toml toml = new Toml().read(new File(this.configPath)); + return toml.getList(key); + } + + public long getLong(String key) { + Toml toml = new Toml().read(new File(this.configPath)); + return toml.getLong(key); + } + + public double getDouble(String key) { + Toml toml = new Toml().read(new File(this.configPath)); + return toml.getDouble(key); + } + +} |