List of usage examples for org.apache.commons.configuration2 PropertiesConfigurationLayout save
public void save(final PropertiesConfiguration config, final Writer out) throws ConfigurationException
From source file:com.thoughtworks.go.agent.AgentAutoRegistrationPropertiesImpl.java
@Override public void scrubRegistrationProperties() { if (!exist()) { return;//from w w w . j a va 2 s . co m } try { PropertiesConfiguration config = new PropertiesConfiguration(); config.setIOFactory(new FilteringOutputWriterFactory()); PropertiesConfigurationLayout layout = new PropertiesConfigurationLayout(); layout.setLineSeparator("\n"); layout.load(config, reader()); try (FileWriter out = new FileWriter(this.configFile)) { layout.save(config, out); } loadProperties(); } catch (ConfigurationException | IOException e) { LOG.warn("[Agent Auto Registration] Unable to scrub registration key.", e); } }