public class GoogleOAuth2Service extends Object
| Constructor and Description |
|---|
GoogleOAuth2Service() |
| Modifier and Type | Method and Description |
|---|---|
String |
getAccessToken()
Gets an access token (refresh it if needed)
|
boolean |
hasCredential()
Indicates if the credential for the service has been set.
|
void |
setCredential(InputStream inputStream)
Sets the service credential.
|
void |
setCredentialFilePath(String credentialFilePath)
Calls
setCredential(InputStream) with a file. |
void |
setCredentialString(String credentialString)
Calls
setCredential(InputStream) with the JSON credential string. |
public boolean hasCredential()
public void setCredential(InputStream inputStream)
inputStream - the input stream where the credential is.setCredentialFilePath(String),
setCredentialString(String)public void setCredentialFilePath(String credentialFilePath)
setCredential(InputStream) with a file.credentialFilePath - the path of the file with the credential.public void setCredentialString(String credentialString)
setCredential(InputStream) with the JSON credential string.credentialString - the JSON credential string.public String getAccessToken() throws IOException
IOException - when an error occurs.Copyright © 2019. All rights reserved.