Class OAuth2CredentialFactoryImpl
java.lang.Object
org.opencastproject.publication.youtube.auth.OAuth2CredentialFactoryImpl
- All Implemented Interfaces:
OAuth2CredentialFactory
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.google.api.client.util.store.DataStore<com.google.api.client.auth.oauth2.StoredCredential> getDataStore(String id, String dataStoreDirectory) Returns a file-backed data store.com.google.api.client.googleapis.auth.oauth2.GoogleCredentialgetGoogleCredential(com.google.api.client.util.store.DataStore<com.google.api.client.auth.oauth2.StoredCredential> datastore, ClientCredentials authContext) Returns aGoogleCredentialfrom a data store.com.google.api.client.googleapis.auth.oauth2.GoogleCredentialgetGoogleCredential(ClientCredentials credentials) Returns aGoogleCredentialfrom the default data store.
-
Constructor Details
-
OAuth2CredentialFactoryImpl
public OAuth2CredentialFactoryImpl()
-
-
Method Details
-
getGoogleCredential
public com.google.api.client.googleapis.auth.oauth2.GoogleCredential getGoogleCredential(ClientCredentials credentials) throws IOException Description copied from interface:OAuth2CredentialFactoryReturns aGoogleCredentialfrom the default data store. If one does not exist, a newGoogleCredentialwill be generated and persisted in the data store.- Specified by:
getGoogleCredentialin interfaceOAuth2CredentialFactory- Returns:
- Google-specific subclass of
Credential - Throws:
IOException- if the default data store is not available
-
getDataStore
public com.google.api.client.util.store.DataStore<com.google.api.client.auth.oauth2.StoredCredential> getDataStore(String id, String dataStoreDirectory) throws IOException Description copied from interface:OAuth2CredentialFactoryReturns a file-backed data store.- Specified by:
getDataStorein interfaceOAuth2CredentialFactory- Parameters:
id- unique identifier for the data storedataStoreDirectory- name of the data store directory- Returns:
- file-backed data store
- Throws:
IOException
-
getGoogleCredential
public com.google.api.client.googleapis.auth.oauth2.GoogleCredential getGoogleCredential(com.google.api.client.util.store.DataStore<com.google.api.client.auth.oauth2.StoredCredential> datastore, ClientCredentials authContext) throws IOException Description copied from interface:OAuth2CredentialFactoryReturns aGoogleCredentialfrom a data store. If one does not exist, a newGoogleCredentialwill be generated and persisted in the data store.- Specified by:
getGoogleCredentialin interfaceOAuth2CredentialFactory- Parameters:
datastore- a file or memory backed data storeauthContext-ClientCredentialsobject containing the parameters needed to find an existing or create a new instance ofGoogleCredential- Returns:
- Google-specific subclass of
Credential - Throws:
IOException- if the default data store is not available
-