You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by js...@apache.org on 2002/09/27 16:20:13 UTC

cvs commit: jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly JellyContext.java

jstrachan    2002/09/27 07:20:13

  Modified:    jelly/src/java/org/apache/commons/jelly JellyContext.java
  Log:
  Applied a modified version of Otto von Wachter's patch for creating relative URI scripts
  
  Revision  Changes    Path
  1.28      +3 -6      jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/JellyContext.java
  
  Index: JellyContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/JellyContext.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- JellyContext.java	25 Sep 2002 08:37:50 -0000	1.27
  +++ JellyContext.java	27 Sep 2002 14:20:13 -0000	1.28
  @@ -756,14 +756,11 @@
        */
       protected URL createRelativeURL(URL rootURL, String relativeURI)
           throws MalformedURLException {
  -        String urlText = null;
           if (rootURL == null) {
  -            String userDir = System.getProperty("user.dir");
  -            urlText = "file://" + userDir + relativeURI;
  -        }
  -        else {
  -            urlText = rootURL.toString() + relativeURI;
  +            File file = new File(System.getProperty("user.dir"));
  +            rootURL = file.toURL();
           }
  +        String urlText = rootURL.toString() + relativeURI;
           if ( log.isDebugEnabled() ) {
               log.debug("Attempting to open url: " + urlText);
           }
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>