Interface ConnectionFactory (1.41.8)

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
NameDescription
urlURL

the URL to which the connection will be made

Returns
TypeDescription
HttpURLConnection

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

Exceptions
TypeDescription
IOException

if there was a problem producing the connection

ClassCastException

if there was a problem producing the connection