List of usage examples for org.apache.commons.configuration XMLConfiguration save
public void save(OutputStream out, String encoding) throws ConfigurationException
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; }