Example usage for org.apache.commons.configuration.io FileHandler save

List of usage examples for org.apache.commons.configuration.io FileHandler save

Introduction

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

Prototype

private void save(FileLocator locator) throws ConfigurationException 

Source Link

Document

Internal helper method for saving data to the internal location stored for this object.

Usage

From source file:ubic.gemma.web.util.ConfigurationCookie.java

public void addProperty(String key, Object value) {
    this.configuration.addProperty(key, value);
    // Rewrite the value.
    StringWriter writer = new StringWriter();
    try {/*from  w w w .j a  va  2 s. c  o  m*/
        FileHandler fh = new FileHandler(configuration);
        fh.save(writer);
    } catch (ConfigurationException e) {
        throw new RuntimeException(e);
    }
    setValue(writer.toString().replaceAll("\n", PROPERTY_DELIMITER));
}

From source file:ubic.gemma.web.util.ConfigurationCookie.java

public void setProperty(String key, Object value) {
    this.configuration.setProperty(key, value);

    // Rewrite the value.
    StringWriter writer = new StringWriter();
    try {/*  ww  w.  j av a2  s  . c  om*/
        FileHandler fh = new FileHandler(configuration);
        fh.save(writer);
    } catch (ConfigurationException e) {
        throw new RuntimeException(e);
    }
    setValue(PROPERTY_DELIMITER + writer.toString().replaceAll("\n", PROPERTY_DELIMITER));
}