DriveResource | Android Developers

Quicknav Quicknav
Links

- Google Play Developer Console
- Android Developers Blog
- About Android

Android Sites

- Android.com
- Android Developers
- Android Open Source Project

Language
close

- - About
  - Wear
  - TV
  - Auto
- - Get Started
  - Devices
  - Style
  - Patterns
  - Building Blocks
  - Downloads
  - Videos
- - Training
  - API Guides
  - Reference
  - Tools
  - Google Services
  - Samples
- - Google Play
  - Essentials
  - Get Users
  - Engage & Retain
  - Monetize
  - Tools & Reference
  - Developer Stories

## Results

Loading...
Summary: Nested Classes | Methods | [Expand All]
public interface

# DriveResource

com.google.android.gms.drive.DriveResource

Known Indirect Subclasses DriveFile, DriveFolder
DriveFile | A file in Drive.
DriveFolder | A folder in Drive.

## Class Overview

A Resource represents a file or folder in Drive.

## Summary

Nested Classes
interface | DriveResource.MetadataResult | Result that is returned in response to metadata requests.

Public Methods
abstract PendingResult<Status> | addChangeListener(GoogleApiClient apiClient, Listener<ChangeEvent> listener) Adds a new listener for changes on this resources.
abstract DriveId | getDriveId() Returns the DriveId that uniquely identifies this resource.
abstract PendingResult<DriveResource.MetadataResult> | getMetadata(GoogleApiClient apiClient) Retrieves the Metadata that is associated with this resource.
abstract PendingResult<DriveApi.MetadataBufferResult> | listParents(GoogleApiClient apiClient) Retrieves a collection of metadata for all of the parents of this resource that the calling app has been authorized to view.
abstract PendingResult<Status> | removeChangeListener(GoogleApiClient apiClient, Listener<ChangeEvent> listener) Removes a listener for changes on this resource that was previously added by `addChangeListener(GoogleApiClient, DriveEvent.Listener)`.
abstract PendingResult<DriveResource.MetadataResult> | updateMetadata(GoogleApiClient apiClient, MetadataChangeSet changeSet) Updates the Metadata that is associated with this resource with the changes described in the `MetadataChangeSet`.

## Public Methods

#### public abstract PendingResult<Status> addChangeListener (GoogleApiClient apiClient, Listener<ChangeEvent> listener)

Adds a new listener for changes on this resources. The listener will remain active for the duration of the current `GoogleApiClient` connection or until the `removeChangeListener(GoogleApiClient, DriveEvent.Listener)` method is called with the same listener argument.

##### See Also

- `ChangeEvent`
- `DriveEvent`

#### public abstract DriveId getDriveId ()

Returns the DriveId that uniquely identifies this resource.

#### public abstract PendingResult<DriveResource.MetadataResult> getMetadata (GoogleApiClient apiClient)

Retrieves the Metadata that is associated with this resource.

##### Parameters

apiClient | The `GoogleApiClient` to service the call.

##### Returns

- a PendingResult which can be used to retrieve the Metadata when it is available.

#### public abstract PendingResult<DriveApi.MetadataBufferResult> listParents (GoogleApiClient apiClient)

Retrieves a collection of metadata for all of the parents of this resource that the calling app has been authorized to view.

##### Parameters

apiClient | The `GoogleApiClient` to service the call.

##### Returns

- a PendingResult which can be used to retrieve the parents list.

#### public abstract PendingResult<Status> removeChangeListener (GoogleApiClient apiClient, Listener<ChangeEvent> listener)

Removes a listener for changes on this resource that was previously added by `addChangeListener(GoogleApiClient, DriveEvent.Listener)`.

#### public abstract PendingResult<DriveResource.MetadataResult> updateMetadata (GoogleApiClient apiClient, MetadataChangeSet changeSet)

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 the metadata (see `isEditable()`). Also, the metadata of the root folder cannot be updated.

##### Parameters

apiClient | The `GoogleApiClient` to service the call. The client must be connected when this method is invoked.
changeSet | The set of changes that will be applied to the Metadata. Only include the specific fields that should be updated.

##### Returns

- a PendingResult which will return the updated Metadata when it is available.