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