com.google.android.gms.drive.DriveApi |
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.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
DriveApi.DriveContentsResult |
Result that contains a DriveContents .
|
||||||||||
DriveApi.DriveIdResult |
Result that contains a DriveId .
|
||||||||||
DriveApi.MetadataBufferResult |
Result that contains a MetadataBuffer .
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Requests a canceling of the actions identified by the specified tags.
| |||||||||||
Retrieves a
DriveId object that can be used in further drive api operations (e.g.
| |||||||||||
Retrieves a
DriveFolder object that can be used to interact with the App
Folder.
| |||||||||||
Retrieves a
DriveFolder object that can be used to interact with the folder specified
by the provided DriveId .
| |||||||||||
Retrieves a
DriveFolder object that can be used to interact with the root folder.
| |||||||||||
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.
| |||||||||||
Retrieves a new
DriveContents instance that can be used to provide initial contents
for a new file.
| |||||||||||
Creates a builder for an Open File activity that allows user selection of a Drive file.
| |||||||||||
Retrieves a collection of metadata for the files and folders that match the specified query.
| |||||||||||
Requests synchronization a
PendingResult that is ready when synchronization has
completed.
|
Requests a canceling of the actions identified by the specified tags.
This method does not guarantee that the requested actions will be canceled as some of the actions may be in a state where they can't be canceled anymore.
Only actions originating from this application and from the account set on this client may be canceled by this call.
It is recommended using this method with actions that were performed with
ExecutionOptions
requesting completion notifications, so that for any canceled
action a CompletionEvent
with status STATUS_CANCELED
is
delivered to the application. This way the application may know which actions were actually
canceled.
trackingTags | the list of tracking tags that identify the actions that should be canceled. |
---|
CompletionEvent
may be used to track the canceled actions.
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.
apiClient | The GoogleApiClient to service the call. |
---|---|
resourceId | The Drive resource id for the DriveId to retrieve. |
Retrieves a DriveFolder
object that can be used to interact with the App
Folder. This method will return synchronously, and is safe to invoke from the UI thread.
The AppData scope is required to access this folder. If the app does not have
SCOPE_APPFOLDER
it will return null.
apiClient | The GoogleApiClient to service the call. The client must be
connected using connect() before invoking this method.
|
---|
Retrieves a DriveFile
object that can be used to interact with the file specified by
the provided DriveId
.
apiClient | The GoogleApiClient to service the call. The client must be
connected using connect() before invoking this method.
|
---|
Retrieves a DriveFolder
object that can be used to interact with the folder specified
by the provided DriveId
.
apiClient | The GoogleApiClient to service the call. The client must be
connected using connect() before invoking this method.
|
---|
Retrieves 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.
apiClient | The GoogleApiClient to service the call. The client must be
connected using connect() before invoking this method.
|
---|
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.
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)
.
apiClient | The GoogleApiClient to service the call. The client must be
connected using connect() before invoking this method. |
---|
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.
Retrieves a collection of metadata for the files and folders that match the specified query.
apiClient | The GoogleApiClient to service the call. |
---|---|
query | The query that will restrict the contents of the result set. |
release()
when you're done with the result.
Requests synchronization a PendingResult
that is ready when synchronization has
completed.
This operation may fail with DRIVE_RATE_LIMIT_EXCEEDED
status,
which indicates that the operation may succeed if reattempted after a sufficient backoff
duration.
apiClient | The GoogleApiClient to service the call. The client must be
connected before invoking this method.
|
---|