You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2004/03/22 12:50:11 UTC

cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core StandardHostDeployer.java

remm        2004/03/22 03:50:11

  Modified:    catalina/src/share/org/apache/catalina/core
                        StandardHostDeployer.java
  Log:
  - Due to the use of the '#' special char to replace '/', the URL must be handled
    in a special way.
  - Bug 27752.
  
  Revision  Changes    Path
  1.22      +17 -4     jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHostDeployer.java
  
  Index: StandardHostDeployer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHostDeployer.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- StandardHostDeployer.java	29 Feb 2004 22:47:21 -0000	1.21
  +++ StandardHostDeployer.java	22 Mar 2004 11:50:11 -0000	1.22
  @@ -19,6 +19,7 @@
   
   
   import java.io.File;
  +import java.io.FileInputStream;
   import java.io.IOException;
   import java.io.InputStream;
   import java.net.URL;
  @@ -461,13 +462,25 @@
   
           // Install the new web application
           this.overrideDocBase = docBase;
  -        if (config.toString().startsWith("file:")) {
  -            this.overrideConfigFile = config.getFile();
  +        String configPath = config.toString();
  +        if (configPath.startsWith("file:")) {
  +            if (configPath.startsWith("file://")) {
  +                configPath = configPath.substring(7);
  +            } else {
  +                configPath = configPath.substring(5);
  +            }
  +            this.overrideConfigFile = (new File(configPath)).getAbsolutePath();
  +        } else {
  +            configPath = null;
           }
   
           InputStream stream = null;
           try {
  -            stream = config.openStream();
  +            if (configPath == null) {
  +                stream = config.openStream();
  +            } else {
  +                stream = new FileInputStream(configPath);
  +            }
               Digester digester = createDigester();
               digester.setClassLoader(this.getClass().getClassLoader());
               digester.clear();
  
  
  

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