airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From samin...@apache.org
Subject svn commit: r1415320 - in /airavata/trunk/modules: commons/utils/src/main/java/org/apache/airavata/common/utils/ServerSettings.java registry/registry-api/src/main/java/org/apache/airavata/registry/api/util/RegistrySettings.java
Date Thu, 29 Nov 2012 18:56:37 GMT
Author: samindaw
Date: Thu Nov 29 18:56:36 2012
New Revision: 1415320

URL: http://svn.apache.org/viewvc?rev=1415320&view=rev
Log:
overload getsettings to have default val

Modified:
    airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ServerSettings.java
    airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/util/RegistrySettings.java

Modified: airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ServerSettings.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ServerSettings.java?rev=1415320&r1=1415319&r2=1415320&view=diff
==============================================================================
--- airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ServerSettings.java
(original)
+++ airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ServerSettings.java
Thu Nov 29 18:56:36 2012
@@ -61,13 +61,16 @@ public class ServerSettings {
     	throw new UnspecifiedServerSettingsException(key);
     }
     
-    public static String getSetting(String key, String defaultValue) throws ServerSettingsException{
-    	validateSuccessfulPropertyFileLoad();
-    	if (properties.containsKey(key)){
-    		return properties.getProperty(key);
-    	}else{
-    		return defaultValue;
-    	}
+    public static String getSetting(String key, String defaultValue){
+    	try {
+			validateSuccessfulPropertyFileLoad();
+			if (properties.containsKey(key)){
+				return properties.getProperty(key);
+			}
+		} catch (ServerSettingsException e) {
+			//we'll ignore this error since a default value is provided
+		}
+		return defaultValue;
     }
     
     public static String getDefaultGatewayId()throws ServerSettingsException{

Modified: airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/util/RegistrySettings.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/util/RegistrySettings.java?rev=1415320&r1=1415319&r2=1415320&view=diff
==============================================================================
--- airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/util/RegistrySettings.java
(original)
+++ airavata/trunk/modules/registry/registry-api/src/main/java/org/apache/airavata/registry/api/util/RegistrySettings.java
Thu Nov 29 18:56:36 2012
@@ -59,13 +59,16 @@ public class RegistrySettings {
     	throw new UnspecifiedRegistrySettingsException(key);
     }
     
-    public static String getSetting(String key, String defaultValue) throws RegistrySettingsException{
-    	validateSuccessfulPropertyFileLoad();
-    	if (properties.containsKey(key)){
-    		return properties.getProperty(key);
-    	}else{
-    		return defaultValue;
-    	}
+    public static String getSetting(String key, String defaultValue){
+    	try {
+			validateSuccessfulPropertyFileLoad();
+			if (properties.containsKey(key)){
+				return properties.getProperty(key);
+			}
+		} catch (RegistrySettingsException e) {
+			//we'll ignore this error since a default value is provided
+		}
+		return defaultValue;
     }
     
     public static String getRegistryAccessorClass() throws RegistrySettingsException{



Mime
View raw message