Class FileCredentialStore

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private FilePersistedCredentials credentials
      Deprecated.
      User credentials repository.
      private java.io.File file
      Deprecated.
      File to store user credentials.
      private static boolean IS_WINDOWS
      Deprecated.
       
      private com.google.api.client.json.JsonFactory jsonFactory
      Deprecated.
      Json factory for serializing user credentials.
      private java.util.concurrent.locks.Lock lock
      Deprecated.
      Lock on access to the store.
      private static java.util.logging.Logger LOGGER
      Deprecated.
       
    • Constructor Summary

      Constructors 
      Constructor Description
      FileCredentialStore​(java.io.File file, com.google.api.client.json.JsonFactory jsonFactory)
      Deprecated.
       
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void delete​(java.lang.String userId, Credential credential)
      Deprecated.
      Deletes the credential of the given user ID.
      protected boolean isSymbolicLink​(java.io.File file)
      Deprecated.
      Returns whether the given file is a symbolic link.
      boolean load​(java.lang.String userId, Credential credential)
      Deprecated.
      Loads the credential for the given user ID.
      private void loadCredentials​(java.io.File file)
      Deprecated.
       
      void migrateTo​(com.google.api.client.util.store.DataStore<StoredCredential> credentialDataStore)
      Deprecated.
      Migrates to the new format using DataStore of StoredCredential.
      void migrateTo​(com.google.api.client.util.store.FileDataStoreFactory dataStoreFactory)
      Deprecated.
      Migrates to the new FileDataStoreFactory format.
      private void save()
      Deprecated.
       
      void store​(java.lang.String userId, Credential credential)
      Deprecated.
      Stores the credential of the given user ID.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • LOGGER

        private static final java.util.logging.Logger LOGGER
        Deprecated.
      • jsonFactory

        private final com.google.api.client.json.JsonFactory jsonFactory
        Deprecated.
        Json factory for serializing user credentials.
      • lock

        private final java.util.concurrent.locks.Lock lock
        Deprecated.
        Lock on access to the store.
      • file

        private final java.io.File file
        Deprecated.
        File to store user credentials.
      • IS_WINDOWS

        private static final boolean IS_WINDOWS
        Deprecated.
    • Constructor Detail

      • FileCredentialStore

        public FileCredentialStore​(java.io.File file,
                                   com.google.api.client.json.JsonFactory jsonFactory)
                            throws java.io.IOException
        Deprecated.
        Parameters:
        file - File to store user credentials
        jsonFactory - JSON factory to serialize user credentials
        Throws:
        java.io.IOException
    • Method Detail

      • isSymbolicLink

        protected boolean isSymbolicLink​(java.io.File file)
                                  throws java.io.IOException
        Deprecated.
        Returns whether the given file is a symbolic link.
        Throws:
        java.io.IOException
        Since:
        1.13
      • store

        public void store​(java.lang.String userId,
                          Credential credential)
                   throws java.io.IOException
        Deprecated.
        Description copied from interface: CredentialStore
        Stores the credential of the given user ID.
        Specified by:
        store in interface CredentialStore
        Parameters:
        userId - user ID whose credential needs to be stored
        credential - credential whose access token, refresh token, and expiration time need to be stored
        Throws:
        java.io.IOException
      • delete

        public void delete​(java.lang.String userId,
                           Credential credential)
                    throws java.io.IOException
        Deprecated.
        Description copied from interface: CredentialStore
        Deletes the credential of the given user ID.
        Specified by:
        delete in interface CredentialStore
        Parameters:
        userId - user ID whose credential needs to be deleted
        credential - credential to be deleted
        Throws:
        java.io.IOException
      • load

        public boolean load​(java.lang.String userId,
                            Credential credential)
        Deprecated.
        Description copied from interface: CredentialStore
        Loads the credential for the given user ID.
        Specified by:
        load in interface CredentialStore
        Parameters:
        userId - user ID whose credential needs to be loaded
        credential - credential whose access token, refresh token, and expiration time need to be set if the credential already exists in storage
        Returns:
        true if the credential has been successfully found and loaded or false otherwise
      • loadCredentials

        private void loadCredentials​(java.io.File file)
                              throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException
      • save

        private void save()
                   throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException
      • migrateTo

        public final void migrateTo​(com.google.api.client.util.store.FileDataStoreFactory dataStoreFactory)
                             throws java.io.IOException
        Deprecated.
        Migrates to the new FileDataStoreFactory format.

        Sample usage:

          public static FileDataStore migrate(FileCredentialStore credentialStore, File dataDirectory)
              throws IOException {
            FileDataStore dataStore = new FileDataStore(dataDirectory);
            credentialStore.migrateTo(dataStore);
            return dataStore;
          }
         
        Parameters:
        dataStoreFactory - file data store factory
        Throws:
        java.io.IOException
        Since:
        1.16
      • migrateTo

        public final void migrateTo​(com.google.api.client.util.store.DataStore<StoredCredential> credentialDataStore)
                             throws java.io.IOException
        Deprecated.
        Migrates to the new format using DataStore of StoredCredential.
        Parameters:
        credentialDataStore - credential data store
        Throws:
        java.io.IOException
        Since:
        1.16