Interface ConnectionFactory
-
- All Known Implementing Classes:
DefaultConnectionFactory
public interface ConnectionFactory
Given aURL
instance, produces anHttpURLConnection
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description HttpURLConnection
openConnection(URL url)
Creates a newHttpURLConnection
from the givenurl
.
-
-
-
Method Detail
-
openConnection
HttpURLConnection openConnection(URL url) throws IOException, ClassCastException
Creates a newHttpURLConnection
from the givenurl
.- Parameters:
url
- the URL to which the conneciton 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
-
-