Stay organized with collections
Save and categorize content based on your preferences.
GoogleApiClientUtilBase
public
class
GoogleApiClientUtilBase
extends Object
java.lang.Object
|
↳ |
com.android.tradefed.util.gcs.GoogleApiClientUtilBase
|
Summary
Fields |
public
static
final
String |
APP_NAME
|
Public methods |
static
HttpRequestInitializer
|
configureRetryStrategy(HttpRequestInitializer initializer)
Setup a retry strategy for the provided HttpRequestInitializer.
|
static
HttpRequestInitializer
|
configureRetryStrategyAndTimeout(HttpRequestInitializer initializer, int connectTimeout, int readTimeout)
Setup a retry strategy for the provided HttpRequestInitializer.
|
static
Credentials
|
createCredential( scopes)
Try to create Google API credential with default credential.
|
static
Credentials
|
createCredentialFromJsonKeyFile(File file, scopes)
Create credential from json key file.
|
static
HttpRequestInitializer
|
setHttpTimeout(HttpRequestInitializer requestInitializer, int connectTimeout, int readTimeout)
|
Fields
APP_NAME
public static final String APP_NAME
Public constructors
GoogleApiClientUtilBase
public GoogleApiClientUtilBase ()
Public methods
public static HttpRequestInitializer configureRetryStrategy (HttpRequestInitializer initializer)
Setup a retry strategy for the provided HttpRequestInitializer. In case of server errors
requests will be automatically retried with an exponential backoff.
Parameters |
initializer |
HttpRequestInitializer : - an initializer which will setup a retry strategy. |
Returns |
HttpRequestInitializer |
an initializer that will retry failed requests automatically. |
public static HttpRequestInitializer configureRetryStrategyAndTimeout (HttpRequestInitializer initializer,
int connectTimeout,
int readTimeout)
Setup a retry strategy for the provided HttpRequestInitializer. In case of server errors
requests will be automatically retried with an exponential backoff.
Parameters |
initializer |
HttpRequestInitializer : - an initializer which will setup a retry strategy. |
connectTimeout |
int |
readTimeout |
int |
Returns |
HttpRequestInitializer |
an initializer that will retry failed requests automatically. |
createCredential
public static Credentials createCredential ( scopes)
Try to create Google API credential with default credential.
Only default credential is used.
Parameters |
scopes |
: scopes for the credential. |
Throws |
|
IOException |
|
GeneralSecurityException |
createCredentialFromJsonKeyFile
public static Credentials createCredentialFromJsonKeyFile (File file,
scopes)
Create credential from json key file.
Parameters |
file |
File : is the p12 key file |
scopes |
: is the API's scope. |
Throws |
|
FileNotFoundException |
|
IOException |
|
GeneralSecurityException |
setHttpTimeout
public static HttpRequestInitializer setHttpTimeout (HttpRequestInitializer requestInitializer,
int connectTimeout,
int readTimeout)
Parameters |
requestInitializer |
HttpRequestInitializer : a HttpRequestInitializer , normally it's Credential . |
connectTimeout |
int : connect timeout in milliseconds. |
readTimeout |
int : read timeout in milliseconds. |
Protected methods
doCreateCredentialFromJsonKeyFile
protected Credentials doCreateCredentialFromJsonKeyFile (File file,
scopes)
Parameters |
file |
File |
scopes |
|
doCreateDefaultCredential
protected Credentials doCreateDefaultCredential ( scopes)
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2024-08-13 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-13 UTC."],[],[]]