code: public static URI url2uri(URL url) throws URISyntaxException {
  		return new URI(
  				url.getProtocol(),
  				url.getAuthority(),
  				url.getPath(),
  				url.getQuery(),
  				url.getRef());
  	}
docs: Convenience method to convert a URL to a URI that doesn't throw a
  URISyntaxException if the path component for the URL contains
  spaces (like {@link URL#toURI()} does).
  
  @param url The input URL
  @return The URI
  @throws URISyntaxException