cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: cocoon-2.1/src/java/org/apache/cocoon/components/resolver DefaultResolver.java
Date Fri, 14 Mar 2003 13:10:54 GMT
cziegeler    2003/03/14 05:10:53

  Modified:    src/java/org/apache/cocoon/components/resolver
                        DefaultResolver.java
  Log:
  Fix for resolving absolute paths on windows
  
  Revision  Changes    Path
  1.5       +13 -6     cocoon-2.1/src/java/org/apache/cocoon/components/resolver/DefaultResolver.java
  
  Index: DefaultResolver.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/resolver/DefaultResolver.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DefaultResolver.java	14 Mar 2003 08:39:16 -0000	1.4
  +++ DefaultResolver.java	14 Mar 2003 13:10:53 -0000	1.5
  @@ -74,12 +74,19 @@
       /**
        * Parse a catalog
        */
  -    protected void parseCatalog(String file) {
  -        // relative uri
  -        if (file.indexOf(":/") == -1 && !file.startsWith("/") ) {
  -            file = "context://" + file;
  +    protected void parseCatalog(String uri) {
  +        // check for relative URIs
  +        //   if the URI has ':/' then it's a URI
  +        //   if the URI starts with '/ it's an absolute (UNIX) path
  +        //   if the URI has a ':' at position 1, it's an absolute windows path
  +        // otherwise we have a relative URI, that is resolved relative
  +        // to the context
  +        if (uri.indexOf(":/") == -1 
  +            && !uri.startsWith("/") 
  +            && !(uri.length() > 1 && uri.charAt(1) == ':')) {
  +                uri = "context://" + uri;
           }
  -        super.parseCatalog( file );
  +        super.parseCatalog( uri );
       }
       
       /**
  
  
  

Mime
View raw message