You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wookie.apache.org by sc...@apache.org on 2011/08/22 14:15:44 UTC
svn commit: r1160234 -
/incubator/wookie/trunk/src/org/apache/wookie/server/ContextListener.java
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);
/*