All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.skife.config.CommonsConfigSource Maven / Gradle / Ivy

Go to download

Full deployment of default TransiStore service, using basic storage types, packaged as "fat jar" with its dependencies.

There is a newer version: 0.9.8
Show newest version
package org.skife.config;

import org.apache.commons.configuration.Configuration;

public class CommonsConfigSource implements ConfigSource
{
    private final Configuration config;

    public CommonsConfigSource(Configuration config) {
        this.config = config;
    }

    public String getString(String propertyName)
    {
        final String [] strings = config.getStringArray(propertyName);
        if (strings == null || strings.length == 0) {
            return null;
        }
        final StringBuilder sb = new StringBuilder();
        for (int i = 0; i < strings.length; i++) {
            sb.append(strings[i]);
            if (i < strings.length - 1) {
                sb.append(',');
            }
        }
        return sb.toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy