code: public static URL toURL(String filename) throws MalformedURLException {
          try {
              return new URL(filename);
          }
          catch (Exception e) {
              return new File(filename).toURI().toURL();
          }
  	}
docs: This method makes a valid URL from a given filename.
  <P>
  This method makes the conversion of this library from the JAVA 2 platform
  to a JDK1.1.x-version easier.
  
  @param filename
  a given filename
  @return a valid URL
  @throws MalformedURLException