incubator-wookie-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scot...@apache.org
Subject svn commit: r1160234 - /incubator/wookie/trunk/src/org/apache/wookie/server/ContextListener.java
Date Mon, 22 Aug 2011 12:15:44 GMT
Author: scottbw
Date: Mon Aug 22 12:15:44 2011
New Revision: 1160234

URL: http://svn.apache.org/viewvc?rev=1160234&view=rev
Log:
Use composite configuration for opensocial properties, as per WOOKIE-187

Modified:
    incubator/wookie/trunk/src/org/apache/wookie/server/ContextListener.java

Modified: incubator/wookie/trunk/src/org/apache/wookie/server/ContextListener.java
URL: http://svn.apache.org/viewvc/incubator/wookie/trunk/src/org/apache/wookie/server/ContextListener.java?rev=1160234&r1=1160233&r2=1160234&view=diff
==============================================================================
--- incubator/wookie/trunk/src/org/apache/wookie/server/ContextListener.java (original)
+++ incubator/wookie/trunk/src/org/apache/wookie/server/ContextListener.java Mon Aug 22 12:15:44
2011
@@ -119,17 +119,11 @@ public class ContextListener implements 
 			 *  load the opensocial.properties file and put it into this context
 			 *  as an attribute 'opensocial' available to all resources
 			 */
-			PropertiesConfiguration opensocialConfiguration;
 			File localOpenSocialPropsFile = new File(System.getProperty("user.dir") + File.separator
+ "local.opensocial.properties");
-			if (localOpenSocialPropsFile.exists()) {
-				opensocialConfiguration = new PropertiesConfiguration(localOpenSocialPropsFile);
-				_logger.info("Using local open social properties file: " + localOpenSocialPropsFile.toString());
-			} else {
-				opensocialConfiguration = new PropertiesConfiguration("opensocial.properties");
-				opensocialConfiguration.setFile(localOpenSocialPropsFile);
-				opensocialConfiguration.save();
-				_logger.info("Using default open social properties, configure your local server using:
" + localOpenSocialPropsFile.toString());
-			}
+            PropertiesConfiguration localOpenSocialConfiguration = new PropertiesConfiguration(localOpenSocialPropsFile);
+            CompositeConfiguration opensocialConfiguration = new CompositeConfiguration();
+            opensocialConfiguration.addConfiguration(localOpenSocialConfiguration);
+            opensocialConfiguration.addConfiguration(new PropertiesConfiguration("opensocial.properties"));
 			context.setAttribute("opensocial", (Configuration) opensocialConfiguration);
 			
 			/*



Mime
View raw message