geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject cvs commit: incubator-geronimo/modules/common/src/java/org/apache/geronimo/common Strings.java
Date Tue, 26 Aug 2003 07:51:06 GMT
jdillon     2003/08/26 00:51:06

  Modified:    modules/common/src/java/org/apache/geronimo/common
                        Strings.java
  Log:
   o urls do not need to be canonical
  
  Revision  Changes    Path
  1.9       +4 -20     incubator-geronimo/modules/common/src/java/org/apache/geronimo/common/Strings.java
  
  Index: Strings.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/common/src/java/org/apache/geronimo/common/Strings.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Strings.java	25 Aug 2003 18:34:38 -0000	1.8
  +++ Strings.java	26 Aug 2003 07:51:06 -0000	1.9
  @@ -678,10 +678,6 @@
        * Make a URL from the given string.
        *
        * <p>
  -     * If the string is a properly formatted file URL, then the file
  -     * portion will be made canonical.
  -     *
  -     * <p>
        * If the string is an invalid URL then it will be converted into a
        * file URL.
        *
  @@ -704,16 +700,7 @@
               }
           }
           catch (Exception e) {
  -            // make sure we have a absolute & canonical file url
  -            try {
  -                url = makeURLFromFilespec(urlspec, relativePrefix);
  -            }
  -            catch (IOException n) {
  -                MalformedURLException mue = 
  -                    new MalformedURLException("Failed to create URL from filespec: " +
urlspec);
  -                mue.initCause(n);
  -                throw mue;
  -            }
  +            url = makeURLFromFilespec(urlspec, relativePrefix);
           }
           
           return url;
  @@ -721,18 +708,15 @@
       
       /** A helper to make a URL from a filespec. */
       private static URL makeURLFromFilespec(final String filespec, final String relativePrefix)
  -        throws IOException
  +        throws MalformedURLException
       {
  -        // make sure the file is absolute & canonical file url
  +        // make sure the file is absolute 
           File file = new File(filespec);
           
           // if we have a prefix and the file is not abs then prepend
           if (relativePrefix != null && !file.isAbsolute()) {
               file = new File(relativePrefix, filespec);
           }
  -        
  -        // make sure it is canonical (no ../ and such)
  -        file = file.getCanonicalFile();
           
           return file.toURL();
       }
  
  
  

Mime
View raw message