Interface ConnectionFactory (1.45.2)

public interface ConnectionFactory

Given a URL instance, produces an HttpURLConnection.

Methods

openConnection(URL url)

public abstract HttpURLConnection openConnection(URL url)

Creates a new HttpURLConnection from the given url.

Parameter
Name Description
url URL

the URL to which the connection will be made

Returns
Type Description
HttpURLConnection

the created connection object, which will still be in the pre-connected state

Exceptions
Type Description
IOException

if there was a problem producing the connection

ClassCastException

if there was a problem producing the connection