public URL toURL () throws MalformedURLException

Constructs a URL from this URI.

This convenience method works as if invoking it were equivalent to evaluating the expression new URL(this.toString()) after first checking that this URI is absolute.

Returns:  A URL constructed from this URI

Exceptions:
IllegalArgumentException     If this URL is not absolute
MalformedURLException     If a protocol handler for the URL could not be found, or if some other error occurred while constructing the URL