use of org.apache.commons.configuration.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(config);
layout.setLineSeparator("\n");
layout.load(reader());
try (FileWriter out = new FileWriter(this.configFile)) {
layout.save(out);
}
loadProperties();
} catch (ConfigurationException | IOException e) {
LOG.warn("[Agent Auto Registration] Unable to scrub registration key.", e);
}
}
use of org.apache.commons.configuration.PropertiesConfigurationLayout in project oxTrust by GluuFederation.
the class UpdateCASAction method disable.
public void disable() {
try {
log.info("disable() CAS call");
// enable server-side storage in idp.properties
String idpConfFolder = shibboleth3ConfService.getIdpConfDir();
PropertiesConfiguration idpPropertiesConfiguration = new PropertiesConfiguration(idpConfFolder + Shibboleth3ConfService.SHIB3_IDP_PROPERTIES_FILE);
PropertiesConfigurationLayout layoutConfiguration = new PropertiesConfigurationLayout(idpPropertiesConfiguration);
// Restore default - client session storage
layoutConfiguration.getConfiguration().setProperty(IDP_SESSION_STORAGESERVICE, CLIENT_SESSION_STORAGESERVICE);
layoutConfiguration.getConfiguration().setProperty(IDP_CAS_STORAGESERVICE, configuration.getSessionStorageType());
layoutConfiguration.getConfiguration().save();
// disable CAS beans in relying-party.xml
updateShibboleth3Configuration();
log.info("disable() CAS - enabled");
} catch (Exception e) {
log.error("disable() CAS exception", e);
}
}
use of org.apache.commons.configuration.PropertiesConfigurationLayout in project jangaroo-tools by CoreMedia.
the class PropertiesClass method getProps.
public List<Property> getProps() {
PropertiesConfigurationLayout layout = properties.getLayout();
List<Property> props = new ArrayList<Property>();
Iterator keys = properties.getKeys();
while (keys.hasNext()) {
String key = (String) keys.next();
props.add(new Property(adjustComment(layout.getCanonicalComment(key, true)), key, isIdentifier(key), properties.getString(key)));
}
return props;
}
use of org.apache.commons.configuration.PropertiesConfigurationLayout in project oxTrust by GluuFederation.
the class UpdateCASAction method enable.
public void enable() {
try {
log.info("enable() CAS call");
// enable server-side storage in idp.properties
String idpConfFolder = shibboleth3ConfService.getIdpConfDir();
PropertiesConfiguration idpPropertiesConfiguration = new PropertiesConfiguration(idpConfFolder + Shibboleth3ConfService.SHIB3_IDP_PROPERTIES_FILE);
PropertiesConfigurationLayout layoutConfiguration = new PropertiesConfigurationLayout(idpPropertiesConfiguration);
// CAS require server-side storage
layoutConfiguration.getConfiguration().setProperty(IDP_SESSION_STORAGESERVICE, configuration.getSessionStorageType());
layoutConfiguration.getConfiguration().setProperty(IDP_CAS_STORAGESERVICE, configuration.getSessionStorageType());
layoutConfiguration.getConfiguration().save();
// enable CAS beans in relying-party.xml
updateShibboleth3Configuration();
log.info("enable() CAS - enabled");
} catch (Exception e) {
log.error("enable() CAS exception", e);
}
}
Aggregations