HttpTransport
instead.@Deprecated public static class JsonHttpClient.Builder extends Object
JsonHttpClient
.
Implementation is not thread-safe.
Modifier | Constructor and Description |
---|---|
protected |
JsonHttpClient.Builder(HttpTransport transport,
JsonFactory jsonFactory,
GenericUrl baseUrl)
Deprecated.
Returns an instance of a new builder.
|
|
JsonHttpClient.Builder(HttpTransport transport,
JsonFactory jsonFactory,
String rootUrl,
String servicePath,
HttpRequestInitializer httpRequestInitializer)
Deprecated.
Returns an instance of a new builder.
|
Modifier and Type | Method and Description |
---|---|
JsonHttpClient |
build()
Deprecated.
Builds a new instance of
JsonHttpClient . |
String |
getApplicationName()
Deprecated.
Returns the application name to be used in the UserAgent header of each request or
null for none. |
GenericUrl |
getBaseUrl()
Deprecated.
Returns the base URL of the service, for example
"https://www.googleapis.com/tasks/v1/" . |
HttpRequestInitializer |
getHttpRequestInitializer()
Deprecated.
Returns the HTTP request initializer or
null for none. |
JsonFactory |
getJsonFactory()
Deprecated.
Returns the JSON factory.
|
JsonHttpRequestInitializer |
getJsonHttpRequestInitializer()
Deprecated.
Returns the JSON HTTP request initializer or
null for none. |
JsonObjectParser |
getObjectParser()
Deprecated.
Returns the JSON parser used or
null if not specified. |
String |
getRootUrl()
Deprecated.
Returns the root URL of the service, for example
https://www.googleapis.com/ . |
String |
getServicePath()
Deprecated.
Returns the service path of the service, for example
"tasks/v1/" . |
HttpTransport |
getTransport()
Deprecated.
Returns the HTTP transport.
|
protected boolean |
isBaseUrlUsed()
Deprecated.
Returns if
baseUrl is used instead of rootUrl and servicePath . |
JsonHttpClient.Builder |
setApplicationName(String applicationName)
Deprecated.
Sets the application name to be used in the UserAgent header of each request or
null
for none. |
JsonHttpClient.Builder |
setBaseUrl(GenericUrl baseUrl)
Deprecated.
Sets the base URL of the service, for example
"https://www.googleapis.com/tasks/v1/" . |
JsonHttpClient.Builder |
setHttpRequestInitializer(HttpRequestInitializer httpRequestInitializer)
Deprecated.
Sets the HTTP request initializer or
null for none. |
JsonHttpClient.Builder |
setJsonHttpRequestInitializer(JsonHttpRequestInitializer jsonHttpRequestInitializer)
Deprecated.
Sets the JSON HTTP request initializer or
null for none. |
JsonHttpClient.Builder |
setObjectParser(JsonObjectParser parser)
Deprecated.
Specifies the JSON parser to use or
null if no used. |
JsonHttpClient.Builder |
setRootUrl(String rootUrl)
Deprecated.
Sets the root URL of the service, for example
https://www.googleapis.com/ . |
JsonHttpClient.Builder |
setServicePath(String servicePath)
Deprecated.
Sets the service path of the service, for example
"tasks/v1/" . |
protected JsonHttpClient.Builder(HttpTransport transport, JsonFactory jsonFactory, GenericUrl baseUrl)
transport
- The transport to use for requestsjsonFactory
- A factory for creating JSON parsers and serializersbaseUrl
- The base URL of the service. Must end with a "/"public JsonHttpClient.Builder(HttpTransport transport, JsonFactory jsonFactory, String rootUrl, String servicePath, HttpRequestInitializer httpRequestInitializer)
transport
- The transport to use for requestsjsonFactory
- A factory for creating JSON parsers and serializersrootUrl
- The root URL of the serviceservicePath
- The service path of the service. It is allowed to be an empty string
""
or a forward slash "/"
, if it is a forward slash then it is treated
as an empty stringhttpRequestInitializer
- The HTTP request initializer or null
for nonepublic JsonHttpClient build()
JsonHttpClient
.protected final boolean isBaseUrlUsed()
baseUrl
is used instead of rootUrl
and servicePath
.public final JsonFactory getJsonFactory()
public final HttpTransport getTransport()
public final JsonObjectParser getObjectParser()
null
if not specified.
Warning: This method will stop returning null
in 1.11, and will return
JsonFactory.createJsonObjectParser()
instead.
public JsonHttpClient.Builder setObjectParser(JsonObjectParser parser)
null
if no used.
Warning: This method will stop accepting null
in 1.11. The default will then be
JsonFactory.createJsonObjectParser()
.
public final GenericUrl getBaseUrl()
"https://www.googleapis.com/tasks/v1/"
. Must be URL-encoded and must end with a "/".
This is determined when the library is generated and normally should not be changed.
Use this method only if baseUrl
is used instead of rootUrl
and
servicePath
.
public JsonHttpClient.Builder setBaseUrl(GenericUrl baseUrl)
"https://www.googleapis.com/tasks/v1/"
.
Must be URL-encoded and must end with a "/". This is determined when the library is generated
and normally should not be changed. Subclasses should override by calling super.
Use this method only if baseUrl
is used instead of rootUrl
and
servicePath
.
public final String getRootUrl()
https://www.googleapis.com/
. Must be
URL-encoded and must end with a "/".
Use this method only if rootUrl
and servicePath
are used instead of
baseUrl
.
public JsonHttpClient.Builder setRootUrl(String rootUrl)
https://www.googleapis.com/
. Must be
URL-encoded. This is determined when the library is generated and normally should be changed.
Subclasses should override by calling super.
If the specified root URL does not end with a "/" then a "/" is added to the end.
Use this method only if rootUrl
and servicePath
are used instead of
baseUrl
.
public final String getServicePath()
"tasks/v1/"
. Must be URL-encoded
and must end with a "/" and not begin with a "/". It is allowed to be an empty string
""
.
Use this method only if rootUrl
and servicePath
are used instead of
baseUrl
.
public JsonHttpClient.Builder setServicePath(String servicePath)
"tasks/v1/"
. Must be URL-encoded.
It is allowed to be an empty string ""
or a forward slash "/"
, if it is a
forward slash then it is treated as an empty string. This is determined when the library is
generated and normally should not be changed. Subclasses should override by calling super.
If the specified service path does not end with a "/" then a "/" is added to the end. If the specified service path begins with a "/" then the "/" is removed.
Use this method only if rootUrl
and servicePath
are used instead of
baseUrl
.
public JsonHttpClient.Builder setJsonHttpRequestInitializer(JsonHttpRequestInitializer jsonHttpRequestInitializer)
null
for none. Subclasses should override
by calling super.public JsonHttpRequestInitializer getJsonHttpRequestInitializer()
null
for none.public JsonHttpClient.Builder setHttpRequestInitializer(HttpRequestInitializer httpRequestInitializer)
null
for none. Subclasses should override by
calling super.public final HttpRequestInitializer getHttpRequestInitializer()
null
for none.public JsonHttpClient.Builder setApplicationName(String applicationName)
null
for none. Subclasses should override by calling super.public final String getApplicationName()
null
for none.Copyright © 2011-2012 Google. All Rights Reserved.