public static Source fromURL(URL url,Charset cs) throws IOException {
  URI uri;
  try {
    uri=url.toURI();
  }
 catch (  URISyntaxException e) {
    throw new IOException("Illegal URI",e);
  }
  try (InputStream is=url.openStream()){
    return fromStream(is,uri,cs);
  }
 }

public static Source fromURL ( URL url , Charset cs ) throws IOException { URI uri ; try { uri = url . toURI ( ) ; } catch ( URISyntaxException e ) { throw new IOException ( "Illegal URI" , e ) ; } try ( InputStream is = url . openStream ( ) ) { return fromStream ( is , uri , cs ) ; } }
creates a new source object from a url
