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.Proxyproxy
-
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.HttpURLConnectionopenConnection(java.net.URL url)Creates a newHttpURLConnectionfrom the givenurl.
-
-
-
Constructor Detail
-
DefaultConnectionFactory
public DefaultConnectionFactory()
-
DefaultConnectionFactory
public DefaultConnectionFactory(java.net.Proxy proxy)
- Parameters:
proxy- HTTP proxy ornullto use the proxy settings from system properties
-
-
Method Detail
-
openConnection
public java.net.HttpURLConnection openConnection(java.net.URL url) throws java.io.IOExceptionDescription copied from interface:ConnectionFactoryCreates a newHttpURLConnectionfrom the givenurl.- Specified by:
openConnectionin 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:
java.io.IOException- if there was a problem producing the connection
-
-