You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by di...@apache.org on 2001/02/15 13:54:45 UTC

cvs commit: xml-cocoon/src/org/apache/cocoon/components/url URLFactoryImpl.java

dims        01/02/15 04:54:44

  Modified:    src/org/apache/cocoon/components/url Tag: xml-cocoon2
                        URLFactoryImpl.java
  Log:
  Create the URL after ensuring that the file exists (relative to the root).
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.4   +5 -2      xml-cocoon/src/org/apache/cocoon/components/url/Attic/URLFactoryImpl.java
  
  Index: URLFactoryImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/components/url/Attic/URLFactoryImpl.java,v
  retrieving revision 1.1.2.3
  retrieving revision 1.1.2.4
  diff -u -r1.1.2.3 -r1.1.2.4
  --- URLFactoryImpl.java	2001/02/14 11:39:45	1.1.2.3
  +++ URLFactoryImpl.java	2001/02/15 12:54:44	1.1.2.4
  @@ -29,7 +29,7 @@
   
   /**
    * @author <a href="mailto:giacomo@apache.org">Giacomo Pati</a>
  - * @version $Id: URLFactoryImpl.java,v 1.1.2.3 2001/02/14 11:39:45 giacomo Exp $
  + * @version $Id: URLFactoryImpl.java,v 1.1.2.4 2001/02/15 12:54:44 dims Exp $
    */
   public class URLFactoryImpl extends AbstractLoggable implements URLFactory, Component, Configurable, Contextualizable {
   
  @@ -68,9 +68,12 @@
   
               String root = (String)context.get(Constants.CONTEXT_ROOT_PATH);
               if (root != null) {
  -                return (new File(root, location)).toURL();
  +                File file = new File(root, location);
  +                if(file.exists())
  +                    return file.toURL();
               }
   
  +            getLogger().debug("Making URL a File (assuming that it is full path)", mue);
               return (new File(location)).toURL();
           }
       }