airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dimuthu...@apache.org
Subject [airavata] 01/02: Reading properties from the environment variables
Date Mon, 02 Nov 2020 19:48:09 GMT
This is an automated email from the ASF dual-hosted git repository.

dimuthuupe pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/airavata.git

commit 4ca774bbd36bd8d8f882b993a4a438283e9ca775
Author: Dimuthu Wannipurage <dimuthu.upeksha2@gmail.com>
AuthorDate: Mon Nov 2 14:47:25 2020 -0500

    Reading properties from the environment variables
---
 .../apache/airavata/common/utils/ApplicationSettings.java  | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/modules/commons/src/main/java/org/apache/airavata/common/utils/ApplicationSettings.java
b/modules/commons/src/main/java/org/apache/airavata/common/utils/ApplicationSettings.java
index f78b196..7340ef9 100644
--- a/modules/commons/src/main/java/org/apache/airavata/common/utils/ApplicationSettings.java
+++ b/modules/commons/src/main/java/org/apache/airavata/common/utils/ApplicationSettings.java
@@ -180,13 +180,17 @@ public class ApplicationSettings {
     }
     
     public String getSettingImpl(String key) throws ApplicationSettingsException{
-    	String rawValue=null;
-    	if (System.getProperties().containsKey(key)){
-    		rawValue=System.getProperties().getProperty(key);
-    	}else{
+    	String rawValue;
+    	if (System.getProperties().containsKey(key)) {
+            rawValue = System.getProperties().getProperty(key);
+
+        } else if (System.getenv().containsKey(key)) {
+    	    rawValue = System.getenv().get(key);
+
+    	} else {
     		validateSuccessfulPropertyFileLoad();
 	    	if (properties.containsKey(key)){
-	    		rawValue=properties.getProperty(key);
+	    		rawValue = properties.getProperty(key);
 	    	}else{
 	    		throw new ApplicationSettingsException(key);
 	    	}


Mime
View raw message