Class FileCredentialStore

    • Constructor Detail

      • FileCredentialStore

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

      • isSymbolicLink

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

        public void delete​(String userId,
                           Credential credential)
                    throws 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:
        IOException
      • load

        public boolean load​(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
      • migrateTo

        public final void migrateTo​(com.google.api.client.util.store.FileDataStoreFactory dataStoreFactory)
                             throws 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:
        IOException
        Since:
        1.16
      • migrateTo

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