public static URL toURL(URI uri){
  if (uri == null)   throw new NullPointerException("`uri' must not be null");
  try {
    return uri.toURL();
  }
 catch (  MalformedURLException e) {
    throw new IllegalArgumentException(uri + " is not a valid URL",e);
  }
}

public static URL toURL ( URI uri ) { if ( uri == null ) throw new NullPointerException ( "`uri' must not be null" ) ; try { return uri . toURL ( ) ; } catch ( MalformedURLException e ) { throw new IllegalArgumentException ( uri + " is not a valid URL" , e ) ; } }
perform the conversion without checked exceptions .
