public interface

DriveApi

com.google.android.gms.drive.DriveApi

This interface is deprecated.
Gain access to the Drive API with one of the Drive#get*Client() methods instead.

Class Overview

The main entry point for interacting with Drive. This class provides methods for obtaining a reference to a file or folder, or querying across the entire Drive.

Summary

Nested Classes
interface DriveApi.DriveContentsResult This interface is deprecated. DriveContents are returned directly in the new Drive clients.  
interface DriveApi.DriveIdResult This interface is deprecated. DriveId are returned directly in the new Drive clients.  
interface DriveApi.MetadataBufferResult This interface is deprecated. MetadataBuffer is returned directly in the new Drive clients.  
Public Methods
abstract PendingResult<DriveApi.DriveIdResult> fetchDriveId(GoogleApiClient apiClient, String resourceId)
This method is deprecated. Use getDriveId(String) instead.
abstract DriveFolder getAppFolder(GoogleApiClient apiClient)
This method is deprecated. Use getAppFolder() instead.
abstract DriveFolder getRootFolder(GoogleApiClient apiClient)
This method is deprecated. Use getRootFolder() instead.
abstract CreateFileActivityBuilder newCreateFileActivityBuilder()
This method is deprecated. Use newCreateFileActivityIntentSender(CreateFileActivityOptions) instead.
abstract PendingResult<DriveApi.DriveContentsResult> newDriveContents(GoogleApiClient apiClient)
This method is deprecated. Use createContents() instead.
abstract OpenFileActivityBuilder newOpenFileActivityBuilder()
This method is deprecated. Use newOpenFileActivityIntentSender(OpenFileActivityOptions) instead.
abstract PendingResult<DriveApi.MetadataBufferResult> query(GoogleApiClient apiClient, Query query)
This method is deprecated. Use query(Query) instead.
abstract PendingResult<Status> requestSync(GoogleApiClient apiClient)
This method is deprecated. Use requestSync() instead.

Public Methods

public abstract PendingResult<DriveApi.DriveIdResult> fetchDriveId (GoogleApiClient apiClient, String resourceId)

This method is deprecated.
Use getDriveId(String) instead.

Retrieves a DriveId object that can be used in further drive api operations (e.g. getFile, getFolder). An error result will be returned if the given resource ID does not exist.

Parameters
apiClient GoogleApiClient: The GoogleApiClient to service the call.
resourceId String: The Drive resource id for the DriveId to retrieve.
Returns
PendingResult<DriveApi.DriveIdResult> A PendingResult which can be used to retrieve the DriveId object.

public abstract DriveFolder getAppFolder (GoogleApiClient apiClient)

This method is deprecated.
Use getAppFolder() instead.

Returns a DriveFolder object that can be used to interact with the App Folder.

The App Folder is a special folder that is only accessible by your application. Its content is hidden from the user and from other apps. Despite being hidden from the user, the App Folder is stored on the user's Drive and therefore uses the user's Drive storage quota.

The App Folder can be used to store configuration files, temporary files, or any other types of files that belong to the user but should not be tampered with.

The AppData scope is required to access this folder. If the app does not have SCOPE_APPFOLDER it will return null.

See the App Folder developer guide for more information.

This method will return synchronously, and is safe to invoke from the UI thread.

Parameters
apiClient GoogleApiClient: The GoogleApiClient to service the call. The client must be connected using connect() before invoking this method.
Returns
DriveFolder
Throws
IllegalStateException if this method is called before the client is connected.

public abstract DriveFolder getRootFolder (GoogleApiClient apiClient)

This method is deprecated.
Use getRootFolder() instead.

Returns a DriveFolder object that can be used to interact with the root folder. This method will return synchronously, and is safe to invoke from the UI thread.

SCOPE_FILE is required to access this folder. If the app only has SCOPE_APPFOLDER it will return null.

Parameters
apiClient GoogleApiClient: The GoogleApiClient to service the call. The client must be connected using connect() before invoking this method.
Returns
DriveFolder
Throws
IllegalStateException if this method is called before the client is connected.

public abstract CreateFileActivityBuilder newCreateFileActivityBuilder ()

This method is deprecated.
Use newCreateFileActivityIntentSender(CreateFileActivityOptions) instead.

Creates a builder for a Create File activity where a user can select a file name and destination for a new binary file in their Drive with the contents and additional metadata provided in the builder.

This method requires authorization with at least one of the following scopes: SCOPE_FILE. Otherwise, a RuntimeException will be thrown when the builder is built.

Returns
CreateFileActivityBuilder

public abstract PendingResult<DriveApi.DriveContentsResult> newDriveContents (GoogleApiClient apiClient)

This method is deprecated.
Use createContents() instead.

Retrieves a new DriveContents instance that can be used to provide initial contents for a new file. The returned contents will be in MODE_WRITE_ONLY and can be used to write the initial contents through the file APIs provided in DriveContents.

To be persisted, the contents must be saved by being passed as initial contents to createFile(GoogleApiClient, MetadataChangeSet, DriveContents) or setInitialDriveContents(DriveContents).

To discard the contents without saving them, invoke discard(GoogleApiClient).

Parameters
apiClient GoogleApiClient: The GoogleApiClient to service the call. The client must be connected using connect() before invoking this method.
Returns
PendingResult<DriveApi.DriveContentsResult> A PendingResult which can be used to retrieve the Contents object.

public abstract OpenFileActivityBuilder newOpenFileActivityBuilder ()

This method is deprecated.
Use newOpenFileActivityIntentSender(OpenFileActivityOptions) instead.

Creates a builder for an Open File activity that allows user selection of a Drive file. Upon completion, the result Intent will contain the DriveId for the selected file. This activity will authorize the requesting app to interact with the selected file.

This method requires authorization with at least one of the following scopes: SCOPE_FILE. Otherwise, a RuntimeException will be thrown when the builder is built.

Returns
OpenFileActivityBuilder

public abstract PendingResult<DriveApi.MetadataBufferResult> query (GoogleApiClient apiClient, Query query)

This method is deprecated.
Use query(Query) instead.

Retrieves a collection of metadata for the files and folders that match the specified query.

Parameters
apiClient GoogleApiClient: The GoogleApiClient to service the call.
query Query: The query that will restrict the contents of the result set.
Returns
PendingResult<DriveApi.MetadataBufferResult> A PendingResult which can be used to retrieve the result set. Be sure to call release() when you're done with the result.

public abstract PendingResult<Status> requestSync (GoogleApiClient apiClient)

This method is deprecated.
Use requestSync() instead.

Requests synchronization with the server to download any metadata changes that occurred since the last sync with the server.

Typically you'd call this method when the user asks to refresh their list of files. Waiting on the PendingResult and then performing a query will return fresh results.

In order to avoid excessive load on the device and the server, sync requests are rate limited. In this case, the operation will fail with DRIVE_RATE_LIMIT_EXCEEDED status, which indicates that a sync already happened quite recently so there is no need for another sync. The operation will succeed when reattempted after a sufficient backoff duration.

Parameters
apiClient GoogleApiClient: The GoogleApiClient to service the call. The client must be connected before invoking this method.
Returns
PendingResult<Status> a PendingResult that returns when synchronization has completed.