Example usage for org.apache.commons.configuration Configuration addProperty

List of usage examples for org.apache.commons.configuration Configuration addProperty

Introduction

In this page you can find the example usage for org.apache.commons.configuration Configuration addProperty.

Prototype

void addProperty(String key, Object value);

Source Link

Document

Add a property to the configuration.

Usage

From source file:org.zaproxy.zap.extension.users.ExtensionUserManagement.java

@Override
public void exportContextData(Context ctx, Configuration config) {
    ContextUserAuthManager m = contextManagers.get(ctx.getIndex());
    if (m != null) {
        for (User u : m.getUsers()) {
            config.addProperty(CONTEXT_CONFIG_USERS_USER, User.encode(u));
        }//from   w  ww . j  av a 2 s.  c  o m
    }
}

From source file:uk.ac.ebi.fg.jobs.JobController.java

private Configuration loadProperties(Configuration properties) {
    if (properties.getString("persistence-location") == null)
        throw new RuntimeException("ae.similarity.persistence-location doesn't exist");

    if (properties != null && !properties.isEmpty()) {
        properties = properties.subset("properties");
        return properties;
    } else {/* w  w w.  ja  va  2  s . c  o m*/
        for (int i = 0; i < defaultProperties.length; i++) {
            properties.addProperty(defaultProperties[i][0], defaultProperties[i][1]);
        }
        logger.error("Default properties loaded.");

        return properties;
    }
}

From source file:umich.ms.batmass.nbputils.config.BmConfig.java

private static <T> void initNewConfiguration(Configuration conf, Class<T> clazz) {
    conf.addProperty("bm.config.forClass", clazz.getName());
}