labs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simo...@apache.org
Subject svn commit: r763496 - /labs/magma/trunk/foundation-basics/src/main/java/org/apache/magma/settings/Settings.java
Date Thu, 09 Apr 2009 02:26:24 GMT
Author: simoneg
Date: Thu Apr  9 02:26:23 2009
New Revision: 763496

URL: http://svn.apache.org/viewvc?rev=763496&view=rev
Log:
LABS-332 : Per user settings

Modified:
    labs/magma/trunk/foundation-basics/src/main/java/org/apache/magma/settings/Settings.java

Modified: labs/magma/trunk/foundation-basics/src/main/java/org/apache/magma/settings/Settings.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/foundation-basics/src/main/java/org/apache/magma/settings/Settings.java?rev=763496&r1=763495&r2=763496&view=diff
==============================================================================
--- labs/magma/trunk/foundation-basics/src/main/java/org/apache/magma/settings/Settings.java
(original)
+++ labs/magma/trunk/foundation-basics/src/main/java/org/apache/magma/settings/Settings.java
Thu Apr  9 02:26:23 2009
@@ -60,6 +60,7 @@
 	PRODUCTION_ENV = "prod";
 	
 	static String environment = System.getProperty("magma.env", DEVEL_ENV);
+	static String username = System.getProperty("user.name");
 	
 	/**
 	 * Retrieves the value of a setting. If settings have not yet been loaded, they are loaded
when needed.
@@ -85,7 +86,7 @@
 	 */
 	public static void init() {
 		String env = environment; 
-		String prefix = null;
+		String prefix = username;
 		SettingsHolder defs = null;
 		holder.initing();
 		if (holder.isInited()) return;
@@ -129,10 +130,12 @@
 				e.printStackTrace();
 			}
 		}
+		holder.overrideWith(loader.getResource("META-INF/magma.properties"));
+		holder.overrideWith(loader.getResource("META-INF/magma.properties.xml"));
 		holder.overrideWith(loader.getResource("META-INF/" + prefix + "magma.properties"));
 		holder.overrideWith(loader.getResource("META-INF/" + prefix + "magma.properties.xml"));
 		holder.overrideWith(loader.getResource("META-INF/" + prefix + "magma" + env + ".properties"));
-		holder.overrideWith(loader.getResource("META-INF/" +prefix + "magma" + env + ".properties.xml"));
+		holder.overrideWith(loader.getResource("META-INF/" + prefix + "magma" + env + ".properties.xml"));
 		holder.overrideWith(new File(prefix + "magma.properties"));		
 		holder.overrideWith(new File(prefix + "magma" + env + ".properties"));
 		holder.inited();



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org


Mime
View raw message