Author: kfujino
Date: Mon May 28 07:18:41 2012
New Revision: 1343155

URL: http://svn.apache.org/viewvc?rev=1343155&view=rev
Log:
fix for Konstantin's review.
Use ContextConfig.getBaseDir() method instead of system property.

Modified:
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java?rev=1343155&r1=1343154&r2=1343155&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java 
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java 
Mon May 28 07:18:41 2012
@@ -655,7 +655,7 @@ public class ContextConfig implements Li
             canonicalAppBase = canonicalAppBase.getCanonicalFile();
         } else {
             canonicalAppBase = 
-                new File(System.getProperty(Globals.CATALINA_BASE_PROP), 
appBase)
+                new File(getBaseDir(), appBase)
                 .getCanonicalFile();
         }
 
@@ -760,7 +760,7 @@ public class ContextConfig implements Li
             if (!docBaseFile.isAbsolute()) {
                 File file = new File(appBase);
                 if (!file.isAbsolute()) {
-                    file = new 
File(System.getProperty(Globals.CATALINA_BASE_PROP), appBase);
+                    file = new File(getBaseDir(), appBase);
                 }
                 docBaseFile = new File(file, docBase);
             }
@@ -1143,8 +1143,7 @@ public class ContextConfig implements Li
      * Get config base.
      */
     protected File getConfigBase() {
-        File configBase = 
-            new File(System.getProperty(Globals.CATALINA_BASE_PROP), "conf");
+        File configBase = new File(getBaseDir(), "conf");
         if (!configBase.exists()) {
             return null;
         }
@@ -1169,8 +1168,7 @@ public class ContextConfig implements Li
             String xmlBase = host.getXmlBase();
             file = new File(xmlBase);
             if (!file.isAbsolute())
-                file = new File(new 
File(System.getProperty(Globals.CATALINA_BASE_PROP)),
-                        xmlBase);
+                file = new File(getBaseDir(), xmlBase);
         } else {
             StringBuilder result = new StringBuilder();
             if (engine != null) {
@@ -1698,15 +1696,11 @@ public class ContextConfig implements Li
      * it.
      */
     protected InputSource getHostWebXmlSource() {
-        String basePath = null;
-        try {
-            basePath = getHostConfigBase().getCanonicalPath();
-        } catch (IOException e) {
-            log.error(sm.getString("contextConfig.baseError"), e);
+        File hostConfigBase = getHostConfigBase();
+        if (!hostConfigBase.exists())
             return null;
-        }
 
-        return getWebXmlSource(Constants.HostWebXml, basePath);
+        return getWebXmlSource(Constants.HostWebXml, hostConfigBase.getPath());
     }
     
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to