Class OAuth2CredentialFactoryImpl

java.lang.Object
org.opencastproject.publication.youtube.auth.OAuth2CredentialFactoryImpl
All Implemented Interfaces:
OAuth2CredentialFactory

public final class OAuth2CredentialFactoryImpl extends Object implements OAuth2CredentialFactory
See Also:
  • GoogleCredential
  • 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: OAuth2CredentialFactory
      Returns a GoogleCredential from the default data store. If one does not exist, a new GoogleCredential will be generated and persisted in the data store.
      Specified by:
      getGoogleCredential in interface OAuth2CredentialFactory
      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: OAuth2CredentialFactory
      Returns a file-backed data store.
      Specified by:
      getDataStore in interface OAuth2CredentialFactory
      Parameters:
      id - unique identifier for the data store
      dataStoreDirectory - 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: OAuth2CredentialFactory
      Returns a GoogleCredential from a data store. If one does not exist, a new GoogleCredential will be generated and persisted in the data store.
      Specified by:
      getGoogleCredential in interface OAuth2CredentialFactory
      Parameters:
      datastore - a file or memory backed data store
      authContext - ClientCredentials object containing the parameters needed to find an existing or create a new instance of GoogleCredential
      Returns:
      Google-specific subclass of Credential
      Throws:
      IOException - if the default data store is not available