public class HttpTransportFactory
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
HttpTransportFactory.HttpTransportType
Types of HttpTransports the factory can create.
|
| Modifier and Type | Field and Description |
|---|---|
static HttpTransportFactory.HttpTransportType |
DEFAULT_TRANSPORT_TYPE |
| Constructor and Description |
|---|
HttpTransportFactory() |
| Modifier and Type | Method and Description |
|---|---|
static com.google.api.client.http.apache.ApacheHttpTransport |
createApacheHttpTransport(org.apache.http.HttpHost proxy)
Create an
ApacheHttpTransport for calling Google APIs with an optional HTTP proxy. |
static com.google.api.client.http.HttpTransport |
createHttpTransport(HttpTransportFactory.HttpTransportType type,
java.lang.String proxyAddress)
Create an
HttpTransport based on an type class and an optional HTTP proxy. |
static com.google.api.client.http.javanet.NetHttpTransport |
createNetHttpTransport(java.net.Proxy proxy)
Create an
NetHttpTransport for calling Google APIs with an optional HTTP proxy. |
static HttpTransportFactory.HttpTransportType |
getTransportTypeOf(java.lang.String typeName)
Utility for getting
HttpTransportFactory.HttpTransportTypes form names, with default. |
static com.google.api.client.http.HttpTransport |
newTrustedTransport()
Convenience method equivalent to
com.google.api.client.googleapis.javanet.GoogleNetHttpTransport#newTrustedTransport(). |
public static final HttpTransportFactory.HttpTransportType DEFAULT_TRANSPORT_TYPE
public static HttpTransportFactory.HttpTransportType getTransportTypeOf(@Nullable java.lang.String typeName)
HttpTransportFactory.HttpTransportTypes form names, with default.typeName - The name of the HttpTransportFactory.HttpTransportType type to return. A default will be
used if null or empty.java.lang.IllegalArgumentException - if the name is not an HttpTransportType.public static com.google.api.client.http.HttpTransport createHttpTransport(HttpTransportFactory.HttpTransportType type, @Nullable java.lang.String proxyAddress) throws java.io.IOException
HttpTransport based on an type class and an optional HTTP proxy.type - The type of HttpTransport to use.proxyAddress - The HTTP proxy to use with the transport. Of the form hostname:port. If
empty no proxy will be used.java.lang.IllegalArgumentException - If the proxy address is invalid.java.io.IOException - If there is an issue connecting to Google's Certification server.public static com.google.api.client.http.apache.ApacheHttpTransport createApacheHttpTransport(@Nullable
org.apache.http.HttpHost proxy)
throws java.io.IOException,
java.security.GeneralSecurityException
ApacheHttpTransport for calling Google APIs with an optional HTTP proxy.proxy - Optional HTTP proxy to use with the transport.java.io.IOException - If there is an issue connecting to Google's certification server.java.security.GeneralSecurityException - If there is a security issue with the keystore.public static com.google.api.client.http.javanet.NetHttpTransport createNetHttpTransport(@Nullable
java.net.Proxy proxy)
throws java.io.IOException,
java.security.GeneralSecurityException
NetHttpTransport for calling Google APIs with an optional HTTP proxy.proxy - Optional HTTP proxy to use with the transport.java.io.IOException - If there is an issue connecting to Google's certification server.java.security.GeneralSecurityException - If there is a security issue with the keystore.public static com.google.api.client.http.HttpTransport newTrustedTransport()
throws java.security.GeneralSecurityException,
java.io.IOException
com.google.api.client.googleapis.javanet.GoogleNetHttpTransport#newTrustedTransport().java.security.GeneralSecurityExceptionjava.io.IOExceptionCopyright © 2018. All rights reserved.