Interface ConnectionFactory
- All Known Implementing Classes:
DefaultConnectionFactory
public interface ConnectionFactory
Given a
URL
instance, produces an HttpURLConnection
.-
Method Summary
Modifier and TypeMethodDescriptionopenConnection
(URL url) Creates a newHttpURLConnection
from the givenurl
.
-
Method Details
-
openConnection
Creates a newHttpURLConnection
from the givenurl
.- Parameters:
url
- the URL to which the connection will be made- Returns:
- the created connection object, which will still be in the pre-connected state
- Throws:
IOException
- if there was a problem producing the connectionClassCastException
- if the URL is not for an HTTP endpoint
-