@Test public void testUrlToUri_3() throws Exception { URL url = new URL( "http: Assert.assertEquals( new URI( "http: UriUtils.urlToUri( url )); }
public static URI urlToUri( URL url ) throws URISyntaxException { URI uri; try { uri = url.toURI(); } catch( Exception e ) { try { uri = new URI( url.getProtocol(), url.getUserInfo(), url.getHost(), url.getPort(), url.getPath(), url.getQuery(), url.getRef()); } catch( Exception e1 ) { throw new URISyntaxException( String.valueOf( url ), "Broken URL." ); } } uri = uri.normalize(); return uri; }
UriUtils { public static URI urlToUri( URL url ) throws URISyntaxException { URI uri; try { uri = url.toURI(); } catch( Exception e ) { try { uri = new URI( url.getProtocol(), url.getUserInfo(), url.getHost(), url.getPort(), url.getPath(), url.getQuery(), url.getRef()); } catch( Exception e1 ) { throw new URISyntaxException( String.valueOf( url ), "Broken URL." ); } } uri = uri.normalize(); return uri; } }
UriUtils { public static URI urlToUri( URL url ) throws URISyntaxException { URI uri; try { uri = url.toURI(); } catch( Exception e ) { try { uri = new URI( url.getProtocol(), url.getUserInfo(), url.getHost(), url.getPort(), url.getPath(), url.getQuery(), url.getRef()); } catch( Exception e1 ) { throw new URISyntaxException( String.valueOf( url ), "Broken URL." ); } } uri = uri.normalize(); return uri; } private  UriUtils(); }
UriUtils { public static URI urlToUri( URL url ) throws URISyntaxException { URI uri; try { uri = url.toURI(); } catch( Exception e ) { try { uri = new URI( url.getProtocol(), url.getUserInfo(), url.getHost(), url.getPort(), url.getPath(), url.getQuery(), url.getRef()); } catch( Exception e1 ) { throw new URISyntaxException( String.valueOf( url ), "Broken URL." ); } } uri = uri.normalize(); return uri; } private  UriUtils(); static URI urlToUri( URL url ); static URI urlToUri( String urlAsString ); static URI buildNewURI( URI referenceUri, String uriSuffix ); }
UriUtils { public static URI urlToUri( URL url ) throws URISyntaxException { URI uri; try { uri = url.toURI(); } catch( Exception e ) { try { uri = new URI( url.getProtocol(), url.getUserInfo(), url.getHost(), url.getPort(), url.getPath(), url.getQuery(), url.getRef()); } catch( Exception e1 ) { throw new URISyntaxException( String.valueOf( url ), "Broken URL." ); } } uri = uri.normalize(); return uri; } private  UriUtils(); static URI urlToUri( URL url ); static URI urlToUri( String urlAsString ); static URI buildNewURI( URI referenceUri, String uriSuffix );  }