Class DataStoreCredentialRefreshListener

java.lang.Object
com.google.api.client.auth.oauth2.DataStoreCredentialRefreshListener
All Implemented Interfaces:
CredentialRefreshListener

@Beta public final class DataStoreCredentialRefreshListener extends Object implements CredentialRefreshListener
Beta
Thread-safe OAuth 2.0 credential refresh listener that stores the refresh token response in the credential data store.

It needs to be added as a refresh listener using Credential.Builder.addRefreshListener(CredentialRefreshListener). Sample usage:

 static void addDataStoreCredentialRefreshListener(
     Credential.Builder credentialBuilder, String userId, DataStoreFactory dataStoreFactory)
     throws IOException {
   credentialBuilder.addRefreshListener(
       new DataStoreCredentialRefreshListener(userId, dataStoreFactory));
 }
Since:
1.6