Package com.yahoo.gsheetjdbc.data
Class GoogleServiceAccountCredentialFetcher
- java.lang.Object
-
- com.yahoo.gsheetjdbc.data.GoogleServiceAccountCredentialFetcher
-
- All Implemented Interfaces:
CredentialFetcher
public class GoogleServiceAccountCredentialFetcher extends Object implements CredentialFetcher
Fetches Google service account credentials.
-
-
Field Summary
Fields Modifier and Type Field Description static StringCREDENTIAL_ENVIRONMENT_VAR
-
Constructor Summary
Constructors Constructor Description GoogleServiceAccountCredentialFetcher()Constructor.GoogleServiceAccountCredentialFetcher(String credentialJson)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.auth.oauth2.GoogleCredentialsgetCredentials()Fetch credentials.
-
-
-
Field Detail
-
CREDENTIAL_ENVIRONMENT_VAR
public static final String CREDENTIAL_ENVIRONMENT_VAR
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GoogleServiceAccountCredentialFetcher
public GoogleServiceAccountCredentialFetcher()
Constructor.
-
GoogleServiceAccountCredentialFetcher
public GoogleServiceAccountCredentialFetcher(String credentialJson)
Constructor.- Parameters:
credentialJson- A string containing service account credential file JSON blob.
-
-
Method Detail
-
getCredentials
public com.google.auth.oauth2.GoogleCredentials getCredentials() throws IOExceptionDescription copied from interface:CredentialFetcherFetch credentials.- Specified by:
getCredentialsin interfaceCredentialFetcher- Returns:
- A set of credentials to access the API.
- Throws:
IOException- If there is an exception fetching credentials.
-
-