public class HttpTransportFactory extends 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,
String proxyAddress)
Create an
HttpTransport based on an type class and an optional HTTP proxy. |
static com.google.api.client.http.javanet.NetHttpTransport |
createNetHttpTransport(Proxy proxy)
Create an
NetHttpTransport for calling Google APIs with an optional HTTP proxy. |
static HttpTransportFactory.HttpTransportType |
getTransportTypeOf(String typeName)
Utility for getting
HttpTransportFactory.HttpTransportType s form names, with default. |
public static final HttpTransportFactory.HttpTransportType DEFAULT_TRANSPORT_TYPE
public static HttpTransportFactory.HttpTransportType getTransportTypeOf(@Nullable String typeName)
HttpTransportFactory.HttpTransportType
s form names, with default.typeName
- The name of the HttpTransportFactory.HttpTransportType
type to return. A default will be
used if null or empty.IllegalArgumentException
- if the name is not an HttpTransportType.public static com.google.api.client.http.HttpTransport createHttpTransport(HttpTransportFactory.HttpTransportType type, @Nullable String proxyAddress) throws 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.IllegalArgumentException
- If the proxy address is invalid.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 IOException, GeneralSecurityException
ApacheHttpTransport
for calling Google APIs with an optional HTTP proxy.proxy
- Optional HTTP proxy to use with the transport.IOException
- If there is an issue connecting to Google's certification server.GeneralSecurityException
- If there is a security issue with the keystore.public static com.google.api.client.http.javanet.NetHttpTransport createNetHttpTransport(@Nullable Proxy proxy) throws IOException, GeneralSecurityException
NetHttpTransport
for calling Google APIs with an optional HTTP proxy.proxy
- Optional HTTP proxy to use with the transport.IOException
- If there is an issue connecting to Google's certification server.GeneralSecurityException
- If there is a security issue with the keystore.Copyright © 2017. All rights reserved.