title: SnakeYAML Dump nested key
body: <p>I am using <code>SnakeYAML</code> as my YAML parser for a project, and I don't know how to set keys that are nested. For instance, here is a YAML file with nested keys in it.</p>
  
  <pre><code>control:
    advertising:
      enabled: true
  logging:
    chat: true
    commands: true
    format: '%id% %date% %username% | %value%'
  </code></pre>
  
  <p>My goal is to be able to easily set the path <code>control.advertising.enabled</code> or <em>any</em> other path to any value.</p>
  
  <p>When I use</p>
  
  <pre><code>void Set(String key, Object value, String configName){
      Yaml yaml = new Yaml();
      OutputStream oS;
      try {
          oS = new FileOutputStream(main.getDataFolder() + File.separator + configName);
      } catch (FileNotFoundException e) {
          e.printStackTrace();
          return;
      }
      Map&lt;String, Object&gt; data = new HashMap&lt;String, Object&gt;();
      // set data based on original + modified
      data.put(key, value);
      String output = yaml.dump(data);
  
      try {
          oS.write(output.getBytes());
      } catch (IOException e) {
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>to set the value, instead of getting</p>
  
  <pre><code>logging:
    chat: true
    commands: true
    format: '%id% %date% %username% | %value%'
  </code></pre>
  
  <p>the entire yaml file is cleared and I only get
  <code>{logging.chat: false}</code></p>
  
  <p>Thank you!</p>