=== modified file 'dhis-2/dhis-support/dhis-support-external/src/main/java/org/hisp/dhis/external/conf/DefaultDhisConfigurationProvider.java' --- dhis-2/dhis-support/dhis-support-external/src/main/java/org/hisp/dhis/external/conf/DefaultDhisConfigurationProvider.java 2015-11-10 17:36:28 +0000 +++ dhis-2/dhis-support/dhis-support-external/src/main/java/org/hisp/dhis/external/conf/DefaultDhisConfigurationProvider.java 2015-11-10 18:15:10 +0000 @@ -30,6 +30,8 @@ import java.io.IOException; import java.io.InputStream; +import java.util.HashMap; +import java.util.Map; import java.util.Properties; import org.apache.commons.logging.Log; @@ -37,6 +39,8 @@ import org.hisp.dhis.external.location.LocationManager; import org.hisp.dhis.external.location.LocationManagerException; +import com.google.common.collect.ImmutableMap; + /** * @author Lars Helge Overland */ @@ -111,6 +115,24 @@ { return properties; } + + @Override + public Map getProperties( String keyBase ) + { + Properties properties = getProperties(); + + Map map = new HashMap<>(); + + for ( String key : properties.stringPropertyNames() ) + { + if ( key != null && key.startsWith( keyBase ) ) + { + map.put( key, properties.getProperty( key ) ); + } + } + + return ImmutableMap.copyOf( map ); + } @Override public String getProperty( ConfigurationKey key ) === modified file 'dhis-2/dhis-support/dhis-support-external/src/main/java/org/hisp/dhis/external/conf/DhisConfigurationProvider.java' --- dhis-2/dhis-support/dhis-support-external/src/main/java/org/hisp/dhis/external/conf/DhisConfigurationProvider.java 2015-10-27 14:11:44 +0000 +++ dhis-2/dhis-support/dhis-support-external/src/main/java/org/hisp/dhis/external/conf/DhisConfigurationProvider.java 2015-11-10 18:15:10 +0000 @@ -1,5 +1,7 @@ package org.hisp.dhis.external.conf; +import java.util.Map; + /* * Copyright (c) 2004-2015, University of Oslo * All rights reserved. @@ -46,6 +48,15 @@ Properties getProperties(); /** + * Get configuration as an immutable map. The maps contains only properties + * which keys are starting with the given key base. + * + * @param keyBase the base for properties to include. + * @return an immutable map of the properties. + */ + Map getProperties( String keyBase ); + + /** * Get the property value for the given key, or the default value for the * configuration key if not exists. *