com.google.android.gms.drive.DriveResource |
![]() |
A Resource represents a file or folder in Drive.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
DriveResource.MetadataResult | Result that is returned in response to metadata requests. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds a new listener for changes on this resource.
| |||||||||||
Adds a change subscription for this resource that will deliver events to the application
event service.
| |||||||||||
Permanently deletes this resource, bypassing trash.
| |||||||||||
Returns the DriveId that uniquely identifies this resource.
| |||||||||||
Retrieves the Metadata associated with this resource.
| |||||||||||
Retrieves a collection of metadata for all of the parents of this resource that the calling
app has been authorized to view.
| |||||||||||
Removes a listener for changes on this resource that was previously added by
addChangeListener(GoogleApiClient, ChangeListener) . | |||||||||||
Removes any existing change subscription for this resource.
| |||||||||||
Sets the parents of this resource.
| |||||||||||
Moves the resource to trash.
| |||||||||||
Moves the resource out of the trash.
| |||||||||||
Updates the Metadata that is associated with this resource with the changes described
in the
MetadataChangeSet . |
Adds a new listener for changes on this resource. The listener will remain active for
the duration of the current GoogleApiClient
connection or until the
removeChangeListener(GoogleApiClient, ChangeListener)
method is called with the same listener argument.
Parameters | |
---|---|
apiClient |
GoogleApiClient
|
listener |
ChangeListener
|
Returns | |
---|---|
PendingResult<Status> |
See also:
Adds a change subscription for this resource that will deliver events to the application
event service. The event service class implementation should contain an
implementation of ChangeListener
and be
exported in the application manifest. The subscription is persistent until the next
device reboot and will be active until the removeChangeSubscription(GoogleApiClient)
method is
called on the same resource.
Parameters | |
---|---|
apiClient |
GoogleApiClient
|
Returns | |
---|---|
PendingResult<Status> |
See also:
Permanently deletes this resource, bypassing trash. The user must be the owner. If the resource is a folder, the app must have access to all descendants of the folder.
For user visible files, we recommend using the trash(GoogleApiClient)
method instead
to give users the opportunity to restore files they have accidentally removed.
Delete must be used for files in the App Folder as they cannot be trashed,
see getAppFolder(GoogleApiClient)
.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The GoogleApiClient to service the call. |
Returns | |
---|---|
PendingResult<Status> |
A PendingResult which can be used to verify the success of the operation. |
Returns the DriveId that uniquely identifies this resource.
Returns | |
---|---|
DriveId |
Retrieves the Metadata associated with this resource.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The GoogleApiClient to service the call. |
Returns | |
---|---|
PendingResult<DriveResource.MetadataResult> |
A PendingResult which can be used to retrieve the Metadata when it is available. |
Retrieves a collection of metadata for all of the parents of this resource that the calling app has been authorized to view.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The GoogleApiClient to service the call. |
Returns | |
---|---|
PendingResult<DriveApi.MetadataBufferResult> |
A PendingResult which can be used to retrieve the parents list. Be sure to call
release() when you're done with the result.
|
Removes a listener for changes on this resource that was previously added by
addChangeListener(GoogleApiClient, ChangeListener)
.
Parameters | |
---|---|
apiClient |
GoogleApiClient
|
listener |
ChangeListener
|
Returns | |
---|---|
PendingResult<Status> |
Removes any existing change subscription for this resource.
Parameters | |
---|---|
apiClient |
GoogleApiClient
|
Returns | |
---|---|
PendingResult<Status> |
Sets the parents of this resource. If successful, the resource parent set will be changed to the one specified in the parameter. The existing parent set will be overwritten. The caller must make sure that the set contains all intended parents of the resource, including existing parents that should remain as parents.
All parents must be folders.
If this resource is in the App Folder or in one of its subfolders, all parents must also belong to the App Folder or one of its subfolders.
If this resource is outside the App Folder every parent must also be outside the App Folder.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The GoogleApiClient to service the call. |
parentIds |
Set :
The set of parents (can be empty) to move the item to. Do NOT modify the set
after calling this method.
|
Returns | |
---|---|
PendingResult<Status> |
Moves the resource to trash. The user must be the owner. If the resource is a folder, the app must have access to all descendants of the folder.
Resources inside the app folder cannot be trashed.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The GoogleApiClient to service the call. The client must be
connected before invoking this method. |
Returns | |
---|---|
PendingResult<Status> |
A PendingResult which can be used to verify the success of the operation. |
Moves the resource out of the trash. The user must be the owner. If the resource is a folder, the app must have access to all descendants of the folder.
Resources inside the app folder cannot be untrashed (they cannot be trashed in the first place).
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The GoogleApiClient to service the call. The client must be
connected before invoking this method. |
Returns | |
---|---|
PendingResult<Status> |
A PendingResult which can be used to verify the success of the operation. |
Updates the Metadata that is associated with this resource with the changes described
in the MetadataChangeSet
.
Note that the user must have edit access to update certain metadata fields (see
MetadataChangeSet.Builder
). Also, the metadata of the root folder cannot be updated.
Parameters | |
---|---|
apiClient |
GoogleApiClient :
The GoogleApiClient to service the call. The client must be
connected when this method is invoked. |
changeSet |
MetadataChangeSet :
The set of changes that will be applied to the Metadata. Only include the
specific fields that should be updated. |
Returns | |
---|---|
PendingResult<DriveResource.MetadataResult> |
A PendingResult which will return the updated Metadata when it is available. |