/**
 * Most of the code in the Qalingo project is copyrighted Hoteia and licensed
 * under the Apache License Version 2.0 (release version 0.8.0)
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 *                   Copyright (c) Hoteia, 2012-2014
 * http://www.hoteia.com - http://twitter.com/hoteia - contact@hoteia.com
 *
 */
package org.hoteia.qalingo.core.web.util;

import java.util.ResourceBundle;

import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class PropertiesUtil extends org.springframework.beans.BeanUtils { 
    
    private static final Logger logger = LoggerFactory.getLogger(PropertiesUtil.class);
    
    public static String getWebappContextKey(final String contextName) {
        String webappContextKey = null;
        try {
            if(StringUtils.isNotEmpty(contextName)){
                String keySuffix = contextName.replace("_", ".").toLowerCase();
                webappContextKey = ResourceBundle.getBundle("engine-setting-webapp-context-qalingo").getString("engine.setting.webapp.context." + keySuffix);
            }
            
        } catch (Exception e) {
            logger.error("This contextName key doesn't exist", e);
        }
        return webappContextKey;
    }
}
@@ -401,30 +401,26 @@
 va.util.
-ResourceBundle
+Properties
 ;%0D%0A%0D%0Aimp
@@ -520,16 +520,143 @@
 actory;%0D
+%0Aimport org.springframework.core.io.Resource;%0D%0Aimport org.springframework.core.io.support.PathMatchingResourcePatternResolver;%0D
 %0A%0D%0Apubli
@@ -1112,149 +1112,600 @@
     
-webappContextKey = ResourceBundle.getBundle(%22engine-setting-webapp-context-qalingo%22).getString(%22engine.setting.webapp.context.%22 + keySuffix);
+PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();%0D%0A                Resource resources%5B%5D = resolver.getResources(%22classpath*:engine-setting-webapp-context*%22);%0D%0A                for (int i = 0; i %3C resources.length; i++) %7B%0D%0A                    Resource resource = resources%5Bi%5D;%0D%0A                    String key = %22engine.setting.webapp.context.%22 + keySuffix;%0D%0A                    Properties prop = new Properties();%0D%0A                    prop.load(resource.getInputStream());%0D%0A                    webappContextKey = prop.getProperty(key);%0D%0A                %7D
 %0D%0A  

fix propertiesUtil with wildcard