Example usage for org.apache.commons.configuration XMLConfiguration save

List of usage examples for org.apache.commons.configuration XMLConfiguration save

Introduction

In this page you can find the example usage for org.apache.commons.configuration XMLConfiguration save.

Prototype

public void save(OutputStream out, String encoding) throws ConfigurationException 

Source Link

Usage

From source file:dk.alexandra.fresco.framework.configuration.ConfigurationGenerator.java

public OutputStream generate(int partyNumber, OutputStream out, List<Pair<String, Integer>> hosts)
        throws Exception {
    XMLConfiguration config = new XMLConfiguration();
    for (int inx = 0; inx < hosts.size(); inx++) {
        config.addProperty("parties.party(-1).hostname", hosts.get(inx).getFirst());
        config.addProperty("parties.party.port", hosts.get(inx).getSecond());
    }//from   ww w  .  j  av  a 2  s. c  o m

    config.save(out, "UTF-8");
    return out;
}