You are viewing a plain text version of this content. The canonical link for it is here.
Posted to svn@forrest.apache.org by th...@apache.org on 2006/04/04 01:18:49 UTC

svn commit: r391173 - /forrest/trunk/main/java/org/apache/forrest/conf/ForrestConfModule.java

Author: thorsten
Date: Mon Apr  3 16:18:47 2006
New Revision: 391173

URL: http://svn.apache.org/viewcvs?rev=391173&view=rev
Log:
Extracting helper method.

Modified:
    forrest/trunk/main/java/org/apache/forrest/conf/ForrestConfModule.java

Modified: forrest/trunk/main/java/org/apache/forrest/conf/ForrestConfModule.java
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/java/org/apache/forrest/conf/ForrestConfModule.java?rev=391173&r1=391172&r2=391173&view=diff
==============================================================================
--- forrest/trunk/main/java/org/apache/forrest/conf/ForrestConfModule.java (original)
+++ forrest/trunk/main/java/org/apache/forrest/conf/ForrestConfModule.java Mon Apr  3 16:18:47 2006
@@ -115,16 +115,8 @@
 
 	public void initialize() throws Exception {
 
-		forrestHome = ForrestConfUtils.getForrestHome();
-		projectHome = ForrestConfUtils.getProjectHome();
-		contextHome = ForrestConfUtils.getContextHome();
-
-		filteringProperties = new AntProperties();
-
-		// add forrest.home and project.home to properties
-		filteringProperties.setProperty("forrest.home", forrestHome);
-		filteringProperties.setProperty("project.home", projectHome);
-		filteringProperties.setProperty("context.home", contextHome);
+        // add all homes important to forrest to the properties
+		setHomes();
 
 		// NOTE: the first values set get precedence, as in AntProperties
 
@@ -208,6 +200,25 @@
 		if (debugging())
 			debug("Loaded project forrest.properties:" + filteringProperties);
 	}
+
+    /**
+     * Sets all forrest related home locations such as
+     * - forrestHome
+     * - projectHome
+     * - contextHome
+     * @throws Exception
+     */
+    private void setHomes() throws Exception {
+        forrestHome = ForrestConfUtils.getForrestHome();
+		projectHome = ForrestConfUtils.getProjectHome();
+		contextHome = ForrestConfUtils.getContextHome();
+
+		filteringProperties = new AntProperties();
+
+		filteringProperties.setProperty("forrest.home", forrestHome);
+		filteringProperties.setProperty("project.home", projectHome);
+		filteringProperties.setProperty("context.home", contextHome);
+    }
 
 	/**
 	 * Override any properties for which a system property exists