tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup SetDocBaseRule.java
Date Mon, 08 Sep 2003 13:43:41 GMT
remm        2003/09/08 06:43:40

  Modified:    catalina/src/share/org/apache/catalina/startup
                        SetDocBaseRule.java
  Log:
  - Bug 22986: Appbase was canonicalized relative to catalina.base even if
    it was already absolute.
  - Also simplify a bit the code by reusing the canonical appBase.
  
  Revision  Changes    Path
  1.8       +12 -11    jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/SetDocBaseRule.java
  
  Index: SetDocBaseRule.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/SetDocBaseRule.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- SetDocBaseRule.java	2 Sep 2003 21:22:00 -0000	1.7
  +++ SetDocBaseRule.java	8 Sep 2003 13:43:40 -0000	1.8
  @@ -136,9 +136,14 @@
               return;
           }
   
  -        File canonicalAppBase = 
  -            new File(System.getProperty("catalina.base"), appBase)
  -            .getCanonicalFile();
  +        File canonicalAppBase = new File(appBase);
  +        if (canonicalAppBase.isAbsolute()) {
  +            canonicalAppBase = canonicalAppBase.getCanonicalFile();
  +        } else {
  +            canonicalAppBase = 
  +                new File(System.getProperty("catalina.base"), appBase)
  +                .getCanonicalFile();
  +        }
   
           String docBase = child.getDocBase();
           if (docBase == null) {
  @@ -160,11 +165,7 @@
   
           File file = new File(docBase);
           if (!file.isAbsolute()) {
  -            // Use the "appBase" property of this container
  -            file = new File(appBase);
  -            if (!file.isAbsolute())
  -                file = canonicalAppBase;
  -            docBase = (new File(file, docBase)).getPath();
  +            docBase = (new File(canonicalAppBase, docBase)).getPath();
           } else {
               docBase = file.getCanonicalPath();
           }
  
  
  

Mime
View raw message