forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nicola...@apache.org
Subject svn commit: rev 10245 - xml/forrest/branches/copyless/src/java/org/apache/forrest/conf
Date Sat, 24 Apr 2004 23:13:11 GMT
Author: nicolaken
Date: Sat Apr 24 16:13:09 2004
New Revision: 10245

Modified:
   xml/forrest/branches/copyless/src/java/org/apache/forrest/conf/ForrestConfModule.java
Log:
Set the dirs to the webapp context if not present as system properties.
Clean up wrong logging.

Modified: xml/forrest/branches/copyless/src/java/org/apache/forrest/conf/ForrestConfModule.java
==============================================================================
--- xml/forrest/branches/copyless/src/java/org/apache/forrest/conf/ForrestConfModule.java
(original)
+++ xml/forrest/branches/copyless/src/java/org/apache/forrest/conf/ForrestConfModule.java
Sat Apr 24 16:13:09 2004
@@ -83,9 +83,9 @@
         String attributeValue = this.getAttributeValues(name, modeConf,
                         objectModel)[0].toString();
 
-        debug(" - Requested:" + name);
-        debug(" - Unfiltered:" + original);
-        debug(" - Given:" + attributeValue);
+        if (debugging()) debug(" - Requested:" + name);
+        if (debugging()) debug(" - Unfiltered:" + original);
+        if (debugging()) debug(" - Given:" + attributeValue);
 
         return attributeValue;
     }
@@ -105,9 +105,10 @@
     private final String getSystemProperty(String propertyName)
                     throws MalformedURLException, IOException {
 
-        String propertyValue = System.getProperty(propertyName, ".");
+        //if the property is not set, default to the webapp context
+        String propertyValue = System.getProperty(propertyName, "context:/");
 
-        debug("system property " + propertyName + "=" + propertyValue);
+        if (debugging()) debug("system property " + propertyName + "=" + propertyValue);
 
         return propertyValue;
     }
@@ -148,7 +149,7 @@
         filteringProperties = 
             loadAntPropertiesFromURI(filteringProperties,defaultRorrestPropertiesStringURI);
 
-        debug("Loaded project forrest.properties:" + filteringProperties);
+        if (debugging()) debug("Loaded project forrest.properties:" + filteringProperties);
     }
 
     /**
@@ -162,15 +163,16 @@
         Source source = null;
         InputStream in = null;
         try {
+           
             source = m_resolver.resolveURI(antPropertiesStringURI);
 
-            debug("Searching for forrest.properties in"
+            if (debugging()) debug("Searching for forrest.properties in"
                                                 + source.getURI());
             in = source.getInputStream();
             filteringProperties = new AntProperties(precedingProperties);
             filteringProperties.load(in);
 
-            debug("Loaded:" + antPropertiesStringURI +
+            if (debugging()) debug("Loaded:" + antPropertiesStringURI +
                                            filteringProperties.toString());
 
         } finally {
@@ -194,15 +196,18 @@
     
     /**
      * Rocked science
+     */
+    private final boolean debugging() {
+        return getLogger().isDebugEnabled();
+   }
+    
+    /**
+     * Rocked science
      * @param debugString
      */
     private final void debug(String debugString) {
-        if (getLogger().isDebugEnabled()) {
             getLogger().debug(debugString);
-        }
    }
-    
-    
     
 }
 

Mime
View raw message