Enclosing FileConfiguration addDefault string in quotes

Discussion in 'Plugin Development' started by darkhelmet, Feb 23, 2014.

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

    darkhelmet

    When using the getConfig().addDefaults() method, it seems that strings are never enclosed in quotes. If I'm adding strings as part of an ArrayList, they are.

    So the following would produce an invalid YML section:

    Code:
    config.addDefault("myplugin.a-config", "this is an invalid option http://example.com");
    This produces:

    Code:
    myplugin:
     
      a-config: this is an invalid option http://example.com
    The API docs don't mention anything.
     
  2. Offline

    Gater12

    darkhelmet
    Have you tried
    Code:
    " 'http://google.com' "
     
  3. Offline

    darkhelmet

Thread Status:
Not open for further replies.

Share This Page