title: How to change .properties file using apache.commons.configuration
body: <p>I have an app where I filter messages according to some rules(existing some keywords or regexps). These rules are to be stored in .properties file(as they must be persistent). I've figured out how to read data from this file. here is the part of the code:</p>
  
  <pre><code>public class Config {
  
      private static final Config ourInstance = new Config();
      private static final CompositeConfiguration prop = new CompositeConfiguration();
  
      public static Config getInstance() {
          return ourInstance;
      }
  
      public Config(){
      }
  
      public synchronized void load() {
          try {
              prop.addConfiguration(new SystemConfiguration());
  
              System.out.println("Loading /rules.properties");
              final PropertiesConfiguration p = new PropertiesConfiguration();
              p.setPath("/home/mikhail/bzrrep/DLP/DLPServer/src/main/resources/rules.properties");
              p.load();
              prop.addConfiguration(p);
  
          } catch (ConfigurationException e) {
              e.printStackTrace();
          }
  
          final int processors = prop.getInt("server.processors", 1);
  
          // If you don't see this line - likely config name is wrong
          System.out.println("Using processors:" + processors);
      }
  
      public void setKeyword(String customerId, String keyword){            
      }    
      public void setRegexp(String customerId, String regexp)
      {}
  }
  </code></pre>
  
  <p>as you see I'm going to add values to some properties. Here is the .properties file itself:</p>
  
  <pre><code>users = admin, root, guest
  users.admin.keywords = admin
  users.admin.regexps = test-5, test-7
  
  users.root.keywords = root
  users.root.regexps = *
  
  users.guest.keywords = guest
  users.guest.regexps = 
  </code></pre>
  
  <p>I have a GUI for user to add keywords and regexps to this config. so, how to implement methods setKeyword and setRegexp?</p>