use of org.apache.commons.configuration2.PropertiesConfigurationLayout in project gocd by gocd.
the class AgentAutoRegistrationPropertiesImpl method scrubRegistrationProperties.
@Override
public void scrubRegistrationProperties() {
if (!exist()) {
return;
}
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);
}
}
Aggregations