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(java.net.URI proxyUri,
org.apache.http.auth.Credentials proxyCredentials)
Create an
ApacheHttpTransport for calling Google APIs with an optional HTTP proxy. |
static com.google.api.client.http.HttpTransport |
createHttpTransport(HttpTransportFactory.HttpTransportType type)
Create an
HttpTransport based on an type class. |
static com.google.api.client.http.HttpTransport |
createHttpTransport(HttpTransportFactory.HttpTransportType type,
java.lang.String proxyAddress,
java.lang.String proxyUsername,
java.lang.String proxyPassword)
Create an
HttpTransport based on an type class and an optional HTTP proxy. |
static com.google.api.client.http.javanet.NetHttpTransport |
createNetHttpTransport(java.net.URI proxyUri,
java.net.PasswordAuthentication proxyAuth)
Create an
NetHttpTransport for calling Google APIs with an optional HTTP proxy. |
public static final HttpTransportFactory.HttpTransportType DEFAULT_TRANSPORT_TYPE
public static com.google.api.client.http.HttpTransport createHttpTransport(HttpTransportFactory.HttpTransportType type) throws java.io.IOException
HttpTransport
based on an type class.type
- The type of HttpTransport to use.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.HttpTransport createHttpTransport(HttpTransportFactory.HttpTransportType type, @Nullable java.lang.String proxyAddress, @Nullable java.lang.String proxyUsername, @Nullable java.lang.String proxyPassword) 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.proxyUsername
- The HTTP proxy username to use with the transport. If empty no proxy
username will be used.proxyPassword
- The HTTP proxy password to use with the transport. If empty no proxy
password 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 java.net.URI proxyUri, @Nullable org.apache.http.auth.Credentials proxyCredentials) throws java.io.IOException, java.security.GeneralSecurityException
ApacheHttpTransport
for calling Google APIs with an optional HTTP proxy.proxyUri
- Optional HTTP proxy URI to use with the transport.proxyCredentials
- Optional HTTP proxy credentials to authenticate with the transport
proxy.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.URI proxyUri, @Nullable java.net.PasswordAuthentication proxyAuth) throws java.io.IOException, java.security.GeneralSecurityException
NetHttpTransport
for calling Google APIs with an optional HTTP proxy.proxyUri
- Optional HTTP proxy URI to use with the transport.proxyAuth
- Optional HTTP proxy credentials to authenticate with the transport proxy.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.Copyright © 2019. All rights reserved.