aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/onap/clamp/clds/config/CldsReferenceProperties.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/main/java/org/onap/clamp/clds/config/CldsReferenceProperties.java b/src/main/java/org/onap/clamp/clds/config/CldsReferenceProperties.java
index a8acdee1..c0f7a728 100644
--- a/src/main/java/org/onap/clamp/clds/config/CldsReferenceProperties.java
+++ b/src/main/java/org/onap/clamp/clds/config/CldsReferenceProperties.java
@@ -50,12 +50,20 @@ public class CldsReferenceProperties {
private String cldsReferenceValuesFile;
@PostConstruct
- public void loadConfig() throws IOException {
+ public void loadConfiguration() throws IOException {
prop = new Properties();
Resource resource = appContext.getResource(cldsReferenceValuesFile);
prop.load(resource.getInputStream());
}
+ public CldsReferenceProperties(String referenceValuesFile) throws IOException {
+ cldsReferenceValuesFile = referenceValuesFile;
+ loadConfiguration();
+ }
+
+ public CldsReferenceProperties() {
+ }
+
/**
* get property value
*
@@ -105,6 +113,7 @@ public class CldsReferenceProperties {
*/
public JsonNode getJsonTemplate(String key1, String key2) throws IOException {
ObjectMapper objectMapper = new ObjectMapper();
- return objectMapper.readValue(getStringValue(key1, key2), JsonNode.class);
+ String result = getStringValue(key1, key2);
+ return (result != null) ? objectMapper.readValue(result, JsonNode.class) : null;
}
}