forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From un...@apache.org
Subject cvs commit: xml-forrest/src/java/org/apache/cocoon/components/modules/input/lm LocationNode.java
Date Wed, 22 Oct 2003 16:55:07 GMT
unico       2003/10/22 09:55:07

  Modified:    src/java/org/apache/cocoon/components/modules/input/lm
                        LocationNode.java
  Log:
  fix relative path resolving
  
  Revision  Changes    Path
  1.2       +9 -6      xml-forrest/src/java/org/apache/cocoon/components/modules/input/lm/LocationNode.java
  
  Index: LocationNode.java
  ===================================================================
  RCS file: /home/cvs/xml-forrest/src/java/org/apache/cocoon/components/modules/input/lm/LocationNode.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LocationNode.java	21 Oct 2003 08:33:36 -0000	1.1
  +++ LocationNode.java	22 Oct 2003 16:55:07 -0000	1.2
  @@ -93,14 +93,17 @@
           
           String src = m_src.resolve(context,om);
           
  -        // absolute, don't prefix
  -        if (src.charAt(0) == '/' || SourceUtil.indexOfSchemeColon(src) != -1) {
  -            return src;
  +        // relative, prefix with locator base
  +        if (src.charAt(0) != '/' && SourceUtil.indexOfSchemeColon(src) == -1) {
  +            String base = (String) context.getMapByAnchor(LocationMap.ANCHOR_NAME).get("base");
  +            src =  base + (base.charAt(base.length()-1) == '/' ? "" : "/") + src;
           }
  -        else {
  -            String base = (String) context.getMapByAnchor("lm").get("base");
  -            return base + (base.charAt(base.length()-1) == '/' ? "" : "/") + src;
  +        
  +        if (getLogger().isDebugEnabled()) {
  +            getLogger().debug("location: " + src);
           }
  +        
  +        return src;
           
       }
   
  
  
  

Mime
View raw message