com.google.android.gms.drive.DriveResource |
![]() |
A Resource represents a file or folder in Drive.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
DriveResource.MetadataResult |
This interface is deprecated.
Metadata objects are returned directly in the new Drive clients.
|
Parameters | |
---|---|
apiClient |
GoogleApiClient |
listener |
ChangeListener |
Returns | |
---|---|
PendingResult<Status> |
See also:
This method is deprecated.
Use addChangeSubscription(DriveResource)
instead.
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:
This method is deprecated.
Use delete(DriveResource)
instead.
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 |
This method is deprecated.
Use getMetadata(DriveResource)
instead.
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. |
This method is deprecated.
Use listParents(DriveResource)
instead.
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. |
This method is deprecated.
Use removeChangeListener(ListenerToken)
instead.
Removes a listener for changes on this resource that was previously added by addChangeListener(GoogleApiClient, ChangeListener)
.
Parameters | |
---|---|
apiClient |
GoogleApiClient |
listener |
ChangeListener |
Returns | |
---|---|
PendingResult<Status> |
This method is deprecated.
Use removeChangeSubscription(DriveResource)
instead.
Removes any existing change subscription for this resource.
Parameters | |
---|---|
apiClient |
GoogleApiClient |
Returns | |
---|---|
PendingResult<Status> |
This method is deprecated.
Use setParents(DriveResource, Set)
instead.
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> |
This method is deprecated.
Use trash(DriveResource)
instead.
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. |
This method is deprecated.
Use untrash(DriveResource)
instead.
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. |
This method is deprecated.
Use updateMetadata(DriveResource, MetadataChangeSet)
instead.
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. |