As I tried to run the code from this webiste, I keep getting the same error no matter what I do to try and resolve it. I've tried:
private void editConfig(String id) {
Yaml yaml = new Yaml();
InputStream inputStream = this.getClass()
.getClassLoader()
.getResourceAsStream("config.yml");
Map<String, Object> obj = yaml.load(inputStream);
System.out.println(obj);
}
I found the answer;
Because the yaml file is in the same package as my class, I am supposed to get rid of the .getClassLoader.