diff options
author | Dan Timoney <dtimoney@att.com> | 2020-03-24 14:30:24 -0400 |
---|---|---|
committer | Dan Timoney <dtimoney@att.com> | 2020-03-25 08:02:59 -0400 |
commit | aee68f0187cbd919ffb544cdd00653d02fd7e991 (patch) | |
tree | ed34ad344d33c4c4162f5778bbedc691e3f6a58d /sliapi | |
parent | 35d9348ab67b6dc3c8e90a2a479f75fcd0af9228 (diff) |
Add env var for svclogic props
Added system property serviceLogicProperties to specify location
of svclogic.properties. If unset, check environment variable
SVCLOGIC_PROPERTIES for the same. If both are unset, defaults to
src/main/resources/svclogic.properties
Change-Id: I8c31a58b69131b08c95a673e0071976f013f941a
Issue-ID: CCSDK-2179
Signed-off-by: Dan Timoney <dtimoney@att.com>
Diffstat (limited to 'sliapi')
-rw-r--r-- | sliapi/springboot/src/main/java/org/onap/ccsdk/sli/core/sliapi/springboot/core/SvcLogicFactory.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sliapi/springboot/src/main/java/org/onap/ccsdk/sli/core/sliapi/springboot/core/SvcLogicFactory.java b/sliapi/springboot/src/main/java/org/onap/ccsdk/sli/core/sliapi/springboot/core/SvcLogicFactory.java index 9b521e4e7..cf8dc5e37 100644 --- a/sliapi/springboot/src/main/java/org/onap/ccsdk/sli/core/sliapi/springboot/core/SvcLogicFactory.java +++ b/sliapi/springboot/src/main/java/org/onap/ccsdk/sli/core/sliapi/springboot/core/SvcLogicFactory.java @@ -63,7 +63,16 @@ public class SvcLogicFactory { @Override
public Properties getProperties() {
Properties props = new Properties();
- String propPath = "src/main/resources/svclogic.properties";
+
+ String propPath = System.getProperty("serviceLogicProperties", "");
+
+ if ("".equals(propPath)) {
+ propPath = System.getenv("SVCLOGIC_PROPERTIES");
+ }
+
+ if ((propPath == null) || propPath.length() == 0) {
+ propPath = "src/main/resources/svclogic.properties";
+ }
System.out.println(propPath);
try (FileInputStream fileInputStream = new FileInputStream(propPath)) {
props = new Properties();
|