Example usage for org.apache.commons.configuration FileConfiguration clearProperty

List of usage examples for org.apache.commons.configuration FileConfiguration clearProperty

Introduction

In this page you can find the example usage for org.apache.commons.configuration FileConfiguration clearProperty.

Prototype

void clearProperty(String key);

Source Link

Document

Remove a property from the configuration.

Usage

From source file:gda.jython.authoriser.FileAuthoriser.java

/**
 * Removes an entry from the file//  w ww. j a  v a2 s  .c o  m
 * 
 * @param username
 */
public void deleteEntry(String username) {
    try {
        FileConfiguration configFile = openConfigFile();
        if (configFile.containsKey(username)) {
            configFile.clearProperty(username);
            configFile.save();
        }
    } catch (Exception e) {
        logger.error("Exception while trying to delete an entry from file" + e.getMessage());
    }
}