Configuration class Yaml

Discussion in 'Plugin Development' started by Jerry Larsson, Feb 11, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    Jerry Larsson

    I've been trying to make a simple yaml file work. I think I might have gotten it wrong.

    I tried this:

            Configuration myConfig = new Configuration(new File("Test.yml"));
            myConfig.setProperty("test.foobar", "Hello World");
    But I always get a NullPointerException from save() no matter what I do.
    Can anyone lead me in the right direction please.

    SOLVED: The file needed to use a directory, since the save(); method checks for the parentFile. file.getParentFile().mkDir(). Without checking if there actually is a parentfile present. So new File("Config/Test.yml") works.
Thread Status:
Not open for further replies.

Share This Page