From aee68f0187cbd919ffb544cdd00653d02fd7e991 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Tue, 24 Mar 2020 14:30:24 -0400 Subject: 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 --- .../sli/core/sliapi/springboot/core/SvcLogicFactory.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 9b521e4e..cf8dc5e3 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(); -- cgit 1.2.3-korg