cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject cvs commit: xml-cocoon2/src/org/apache/cocoon/components/url URLFactoryImpl.java
Date Sun, 05 Aug 2001 16:56:36 GMT
vgritsenko    01/08/05 09:56:36

  Modified:    src/org/apache/cocoon/components/url Tag: cocoon_20_branch
                        URLFactoryImpl.java
  Log:
  Make 'file:' protocol url always have '/'
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.2.2.6   +8 -2      xml-cocoon2/src/org/apache/cocoon/components/url/URLFactoryImpl.java
  
  Index: URLFactoryImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/url/URLFactoryImpl.java,v
  retrieving revision 1.2.2.5
  retrieving revision 1.2.2.6
  diff -u -r1.2.2.5 -r1.2.2.6
  --- URLFactoryImpl.java	2001/07/13 11:26:58	1.2.2.5
  +++ URLFactoryImpl.java	2001/08/05 16:56:36	1.2.2.6
  @@ -29,7 +29,7 @@
   
   /**
    * @author <a href="mailto:giacomo@apache.org">Giacomo Pati</a>
  - * @version $Id: URLFactoryImpl.java,v 1.2.2.5 2001/07/13 11:26:58 cziegeler Exp $
  + * @version $Id: URLFactoryImpl.java,v 1.2.2.6 2001/08/05 16:56:36 vgritsenko Exp $
    */
   public class URLFactoryImpl extends AbstractLoggable implements URLFactory, Component,
Configurable, Contextualizable {
   
  @@ -95,7 +95,13 @@
           if ( base != null ) {
               if (base.getProtocol().equals("file")) {
                   File temp = new File(base.toExternalForm().substring("file:".length()),
location);
  -                return getURL("file:" + temp.getAbsolutePath());
  +                String path = temp.getAbsolutePath();
  +                // VG: M$ paths starts with drive letter
  +                if (path.charAt(0) != File.separator.charAt(0)) {
  +                    return getURL("file:/" + path);
  +                } else {
  +                    return getURL("file:" + path);
  +                }
               }
   
               return getURL(new URL(base, location).toExternalForm());
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message