Add env var for svclogic props 86/104286/2
authorDan Timoney <dtimoney@att.com>
Tue, 24 Mar 2020 18:30:24 +0000 (14:30 -0400)
committerDan Timoney <dtimoney@att.com>
Wed, 25 Mar 2020 12:02:59 +0000 (08:02 -0400)
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>
sliapi/springboot/src/main/java/org/onap/ccsdk/sli/core/sliapi/springboot/core/SvcLogicFactory.java

index 9b521e4..cf8dc5e 100644 (file)
@@ -63,7 +63,16 @@ public class SvcLogicFactory {
       @Override\r
       public Properties getProperties() {\r
         Properties props = new Properties();\r
-        String propPath = "src/main/resources/svclogic.properties";\r
+\r
+        String propPath = System.getProperty("serviceLogicProperties", "");\r
+\r
+        if ("".equals(propPath)) {\r
+          propPath = System.getenv("SVCLOGIC_PROPERTIES");\r
+        }\r
+\r
+        if ((propPath == null) || propPath.length() == 0) {\r
+          propPath = "src/main/resources/svclogic.properties";\r
+        }\r
         System.out.println(propPath);\r
         try (FileInputStream fileInputStream = new FileInputStream(propPath)) {\r
           props = new Properties();\r