use of org.apache.commons.configuration.ConfigurationBuilder in project engine by craftercms.
the class SiteContextFactory method getConfig.
protected HierarchicalConfiguration getConfig(SiteContext siteContext, String[] configPaths, ResourceLoader resourceLoader) {
String siteName = siteContext.getSiteName();
try {
logger.info("--------------------------------------------------");
logger.info("<Loading configuration for site: " + siteName + ">");
logger.info("--------------------------------------------------");
ConfigurationBuilder builder = new MultiConfigurationBuilder(configPaths, resourceLoader);
HierarchicalConfiguration config = (HierarchicalConfiguration) builder.getConfiguration();
logger.info("--------------------------------------------------");
logger.info("</Loading configuration for site: " + siteName + ">");
logger.info("--------------------------------------------------");
return config;
} catch (ConfigurationException e) {
throw new SiteContextCreationException("Unable to load configuration for site '" + siteContext.getSiteName() + "'", e);
}
}
Aggregations