Class GoogleOAuth2Service


  • public class GoogleOAuth2Service
    extends Object
    • Constructor Detail

      • GoogleOAuth2Service

        public GoogleOAuth2Service()
    • Method Detail

      • hasCredential

        public boolean hasCredential()
        Indicates if the credential for the service has been set.
        Returns:
        true if we have credential, false if we need to set it.
      • setCredentialFilePath

        public void setCredentialFilePath​(String credentialFilePath)
        Calls setCredential(InputStream) with a file.
        Parameters:
        credentialFilePath - the path of the file with the credential.
      • setCredentialString

        public void setCredentialString​(String credentialString)
        Calls setCredential(InputStream) with the JSON credential string.
        Parameters:
        credentialString - the JSON credential string.
      • getAccessToken

        public String getAccessToken()
                              throws IOException
        Gets an access token (refresh it if needed)
        Returns:
        the access token for the service.
        Throws:
        IOException - when an error occurs.