X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fonap%2Fclamp%2Fclds%2Fconfig%2Fspring%2FCldsConfiguration.java;h=8372e3f59de3a0e931a3c9fb5a1f8b18299541de;hb=12d39d3873ced59a1b10f8ce3a7a90c33328641c;hp=37de83308f97a4bd103344d07b5f6fa86203b428;hpb=aa8d13e4fb8ea099c85969de91eff2d89190c366;p=clamp.git diff --git a/src/main/java/org/onap/clamp/clds/config/spring/CldsConfiguration.java b/src/main/java/org/onap/clamp/clds/config/spring/CldsConfiguration.java index 37de8330..8372e3f5 100644 --- a/src/main/java/org/onap/clamp/clds/config/spring/CldsConfiguration.java +++ b/src/main/java/org/onap/clamp/clds/config/spring/CldsConfiguration.java @@ -26,21 +26,28 @@ package org.onap.clamp.clds.config.spring; import javax.sql.DataSource; import javax.xml.transform.TransformerConfigurationException; +import org.onap.clamp.clds.config.ClampProperties; import org.onap.clamp.clds.config.EncodedPasswordBasicDataSource; import org.onap.clamp.clds.dao.CldsDao; import org.onap.clamp.clds.transform.XslTransformer; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.config.PropertiesFactoryBean; import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; -import org.springframework.core.io.ClassPathResource; @Configuration @Profile("clamp-default") public class CldsConfiguration { + @Autowired + private ApplicationContext appContext; + @Autowired + private ClampProperties refProp; + /** * Clds Identity database DataSource configuration * @@ -55,7 +62,7 @@ public class CldsConfiguration { @Bean(name = "mapper") public PropertiesFactoryBean mapper() { PropertiesFactoryBean bean = new PropertiesFactoryBean(); - bean.setLocation(new ClassPathResource("system.properties")); + bean.setLocation(appContext.getResource(refProp.getStringValue("files.systemProperties"))); return bean; }