cziegeler    02/02/19 06:26:52

  Modified:    src/java/org/apache/cocoon/environment
                        AbstractEnvironment.java
  Log:
  This should be now the correct file URI handling...
  
  Revision  Changes    Path
  1.9       +8 -4      
xml-cocoon2/src/java/org/apache/cocoon/environment/AbstractEnvironment.java
  
  Index: AbstractEnvironment.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/environment/AbstractEnvironment.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- AbstractEnvironment.java  19 Feb 2002 12:02:01 -0000      1.8
  +++ AbstractEnvironment.java  19 Feb 2002 14:26:52 -0000      1.9
  @@ -73,7 +73,7 @@
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Giacomo Pati</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Carsten Ziegeler</a>
  - * @version CVS $Id: AbstractEnvironment.java,v 1.8 2002/02/19 12:02:01 cziegeler 
Exp $
  + * @version CVS $Id: AbstractEnvironment.java,v 1.9 2002/02/19 14:26:52 cziegeler 
Exp $
    */
   public abstract class AbstractEnvironment extends AbstractLoggable implements 
Environment {
   
  @@ -339,14 +339,18 @@
           if (systemId.length() == 0) {
               source = this.sourceHandler.getSource(this, 
this.context.toExternalForm());
           } else if (systemId.charAt(0) == '/') {
  -            source = this.sourceHandler.getSource(this, this.context.getProtocol() +
  +            // windows: absolute paths can start with / followed by a drive letter
  +            if (systemId.length() > 2 && systemId.charAt(2) == ':') {
  +                source = this.sourceHandler.getSource(this, "file:" + systemId);
  +            } else {
  +                source = this.sourceHandler.getSource(this, 
this.context.getProtocol() +
                                                     ":" + systemId);
  +            }
           } else if (systemId.indexOf(":") > 1) {
               source = this.sourceHandler.getSource(this, systemId);
           // windows: absolute paths can start with drive letter
           } else if (systemId.length() > 1 && systemId.charAt(1) == ':') {
  -            source = this.sourceHandler.getSource(this, this.context.getProtocol() +
  -                                                  ":/" + systemId);
  +            source = this.sourceHandler.getSource(this, "file:/" + systemId);
           } else {
               source = this.sourceHandler.getSource(this, this.context, systemId);
           }
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to