public static UrlBuilder getUrlBuilder ( final URL baseUrl ) { URL url = null ; try { url = new URL ( decode ( requireNonNull ( baseUrl ) . toString ( ) , defaultCharset ( ) . name ( ) ) ) ; } catch ( MalformedURLException | UnsupportedEncodingException e ) { throw new IllegalArgumentException ( new StringBuilder ( "Cannot create a URI from the provided URL: " ) . append ( baseUrl != null ? baseUrl . toString ( ) : "null" ) . toString ( ) , e ) ; } return new UrlBuilder ( url ) ; }
Convenient factory method that creates a new instance of this class .