public static URL newUrl ( String spec ) { try { return new URL ( spec ) ; } catch ( MalformedURLException exception ) { throw new IllegalArgumentException ( "Invalid URL: " + spec ) ; } }
Creates a URL for the specified string representation .