diff --git a/src/main/java/wtf/beatrice/hidekobot/Configuration.java b/src/main/java/wtf/beatrice/hidekobot/Cache.java similarity index 99% rename from src/main/java/wtf/beatrice/hidekobot/Configuration.java rename to src/main/java/wtf/beatrice/hidekobot/Cache.java index ee9b8b1..8d66843 100644 --- a/src/main/java/wtf/beatrice/hidekobot/Configuration.java +++ b/src/main/java/wtf/beatrice/hidekobot/Cache.java @@ -11,7 +11,7 @@ import java.util.ArrayList; import java.util.Comparator; import java.util.List; -public class Configuration +public class Cache { diff --git a/src/main/java/wtf/beatrice/hidekobot/utils/ConfigurationUtil.java b/src/main/java/wtf/beatrice/hidekobot/utils/ConfigurationUtil.java new file mode 100644 index 0000000..5103f7b --- /dev/null +++ b/src/main/java/wtf/beatrice/hidekobot/utils/ConfigurationUtil.java @@ -0,0 +1,40 @@ +package wtf.beatrice.hidekobot.utils; + +import org.yaml.snakeyaml.Yaml; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Map; + +public class ConfigurationUtil +{ + private final String configFilePath; + + public ConfigurationUtil(String configFilePath) + { + this.configFilePath = configFilePath; + } + + public void initConfig() + { + Yaml internalConfigYaml = new Yaml(); + Map internalConfigContents = null; + + try (InputStream internalConfigStream = getClass() + .getClassLoader() + .getResourceAsStream("config.yml")) + { + internalConfigContents = internalConfigYaml.load(internalConfigStream); + } catch (IOException e) { + e.printStackTrace(); + } + + if(internalConfigContents == null) // todo error handling + { + + return; + } + + + } +}