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

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

Introduction

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

Prototype

Iterator getKeys();

Source Link

Document

Get the list of the keys contained in the configuration.

Usage

From source file:org.xmlactions.pager.context.ShowExecContext.java

public static String showConfiguration(Configuration configuration, String name) {
    StringBuilder sb = new StringBuilder();
    Iterator<String> iterator = configuration.getKeys();
    while (iterator.hasNext()) {
        String key = iterator.next();
        Object obj = configuration.getProperty(key);
        sb.append(lf + name + "." + key + " = " + obj.toString());
    }//from  w  w w .ja  v a2 s  .  c o m
    return sb.toString();
}

From source file:uk.co.gidley.jmxmonitor.services.InternalJmx.java

public void start(Configuration configuration) throws InitialisationException {

    Iterator<String> keys = configuration.getKeys();
    while (keys.hasNext()) {
        String key = keys.next();
        if (key.equals(PROPERTY_PREFIX + LOCAL_RMI_PORT)) {
            startRmiRegistry(configuration);
            startJmxConnector(configuration);
        }//from w  ww  . j a va 2  s.  c  o m
    }

}

From source file:wherehows.common.utils.JobsUtil.java

public static Properties getJobConfigProperties(File jobConfigFile) throws ConfigurationException {
    Properties prop = new Properties();
    String propValues = "";

    Configuration jobParam = new PropertiesConfiguration(jobConfigFile.getAbsolutePath());

    if (jobParam != null) {
        Iterator<String> keyit = jobParam.getKeys();
        while (keyit.hasNext()) {
            String key = keyit.next();
            if (key != null) {
                Object value = jobParam.getProperty(key);
                if (value != null && value instanceof String[]) {
                    propValues = String.join(",", (String[]) value);
                    prop.setProperty(key, splitAndResolveEnvironmentalValues(propValues));
                } else if (value != null && value instanceof List<?>) {
                    propValues = String.join(",", (List<String>) value);
                    prop.setProperty(key, splitAndResolveEnvironmentalValues(propValues));
                } else if (value != null) {
                    prop.setProperty(key, resolveEnviornmentalVariable(value.toString()));
                }/*ww  w .  j av a  2 s  . co  m*/
            }
        }
    }
    return prop;
}