public final class URIUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static HttpURLConnection |
openHttpConnection(URI uri)
Returns a
HttpURLConnection instance that represents a connection to the
remote object referred by the uri. |
public static HttpURLConnection openHttpConnection(URI uri) throws IOException
HttpURLConnection instance that represents a connection to the
remote object referred by the uri.
The uri must represent a HTTP(S) resource.
If uri contains the user info part, set the Authorization header
with Basic authentication credentials.uri - the URI to open connection from.HttpURLConnection to the uri.IOException - if an I/O exception occurs.ClassCastException - if the connection is not instance of HttpURLConnection.Copyright © 2021. All rights reserved.