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 Fri, 25 Jul 2003 16:43:53 GMT
remm        2003/07/25 09:43:53

  Modified:    catalina/src/share/org/apache/catalina/startup
                        SetDocBaseRule.java
  Log:
  - Attempt to guess docbase if not set.
  
  Revision  Changes    Path
  1.4       +20 -3     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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SetDocBaseRule.java	9 Jul 2003 19:54:34 -0000	1.3
  +++ SetDocBaseRule.java	25 Jul 2003 16:43:53 -0000	1.4
  @@ -139,6 +139,23 @@
               .getCanonicalFile();
   
           String docBase = child.getDocBase();
  +        if (docBase == null) {
  +            // Trying to guess the docBase according to the path
  +            String path = child.getPath();
  +            if (path == null) {
  +                return;
  +            }
  +            if (path.equals("")) {
  +                docBase = "ROOT";
  +            } else {
  +                if (path.startsWith("/")) {
  +                    docBase = path.substring(1);
  +                } else {
  +                    docBase = path;
  +                }
  +            }
  +        }
  +
           File file = new File(docBase);
           if (!file.isAbsolute()) {
               // Use the "appBase" property of this container
  
  
  

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


Mime
View raw message