Class DefaultConnectionFactory
- java.lang.Object
-
- com.google.api.client.http.javanet.DefaultConnectionFactory
-
- All Implemented Interfaces:
ConnectionFactory
public class DefaultConnectionFactory extends Object implements ConnectionFactory
Default implementation ofConnectionFactory
, which simply attempts to open the connection with an optionalProxy
.
-
-
Constructor Summary
Constructors Constructor Description DefaultConnectionFactory()
DefaultConnectionFactory(Proxy proxy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpURLConnection
openConnection(URL url)
Creates a newHttpURLConnection
from the givenurl
.
-
-
-
Constructor Detail
-
DefaultConnectionFactory
public DefaultConnectionFactory()
-
DefaultConnectionFactory
public DefaultConnectionFactory(Proxy proxy)
- Parameters:
proxy
- HTTP proxy ornull
to use the proxy settings from system properties
-
-
Method Detail
-
openConnection
public HttpURLConnection openConnection(URL url) throws IOException
Description copied from interface:ConnectionFactory
Creates a newHttpURLConnection
from the givenurl
.- Specified by:
openConnection
in interfaceConnectionFactory
- 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 connection
-
-