Example usage for org.apache.commons.configuration PropertiesConfiguration save

List of usage examples for org.apache.commons.configuration PropertiesConfiguration save

Introduction

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

Prototype

public void save() throws ConfigurationException 

Source Link

Document

Save the configuration.

Usage

From source file:umich.ms.batmass.projects.core.type.defaultoperations.BMProjectMoveOrRenameoperation.java

@Override
public void notifyRenamed(String nueName) throws IOException {
    NotifyDescriptor.InputLine input = new NotifyDescriptor.InputLine("new name is",
            "In CustomerProjectMoveOrRenameOperation.notifyRenamed()");
    input.setInputText(nueName);/*  ww  w.  j a  va  2  s  .  c o  m*/
    Object result = DialogDisplayer.getDefault().notify(input);

    try {
        if (this == null) {
            throw new IllegalArgumentException("Project is null");
        }

        if (!ProjectOperations.isMoveOperationSupported(project)) {
            throw new IllegalArgumentException("Attempt to rename project that does not support move.");
        }

        PropertiesConfiguration config = project.getConfig();
        config.setProperty("project.name", nueName);
        config.save();

    } catch (ConfigurationException ex) {
        Exceptions.printStackTrace(ex);
    }
}