src/main/java/org/jboss/util/Strings.java
/** A helper to make a URL from a filespec. */
A helper to make a URL from a filespec.
A helper to make a URL from a filespec .
private static URL makeURLFromFilespec(final String filespec, final String relativePrefix)
      throws IOException
   {
      File file = new File(decode(filespec));
      if (relativePrefix != null && !file.isAbsolute())
      {
         file = new File(relativePrefix, filespec);
      }
      file = file.getCanonicalFile();
      return file.toURI().toURL();
   }
private static URL makeURLFromFilespec ( final String filespec , final String relativePrefix ) throws IOException { File file = new File ( decode ( filespec ) ) ; if ( relativePrefix != null && ! file . isAbsolute ( ) ) { file = new File ( relativePrefix , filespec ) ; } file = file . getCanonicalFile ( ) ; return file . toURI ( ) . toURL ( ) ; }
A helper to make a URL from a filespec.
A helper to make a URL from a filespec .
// make sure the file is absolute & canonical file url // if we have a prefix and the file is not abs then prepend // make sure it is canonical (no ../ and such)