public interface

DriveFolder

implements DriveResource
com.google.android.gms.drive.DriveFolder

Class Overview

A folder in Drive. This class provides access to list or query the contents of the folder, or create new resources within it.

To retrieve a DriveFolder from a known drive id, use getFolder(GoogleApiClient, DriveId).

Summary

Nested Classes
interface DriveFolder.DriveFileResult A result that contains a DriveFile. 
interface DriveFolder.DriveFolderResult A result that contains a DriveFolder. 
Constants
String MIME_TYPE The MIME type associated with folder resources.
Public Methods
abstract PendingResult<DriveFolder.DriveFileResult> createFile(GoogleApiClient apiClient, MetadataChangeSet changeSet, Contents contents)
Creates a new binary file within this folder, with the provided initial metadata and contents.
abstract PendingResult<DriveFolder.DriveFolderResult> createFolder(GoogleApiClient apiClient, MetadataChangeSet changeSet)
Creates a new folder within this folder, with the provided initial metadata.
abstract PendingResult<DriveApi.MetadataBufferResult> listChildren(GoogleApiClient apiClient)
Retrieves a collection of metadata for the direct children of this folder.
abstract PendingResult<DriveApi.MetadataBufferResult> queryChildren(GoogleApiClient apiClient, Query query)
Retrieves a collection of metadata for the all authorized direct children of this folder.
[Expand]
Inherited Methods
From interface com.google.android.gms.drive.DriveResource

Constants

public static final String MIME_TYPE

The MIME type associated with folder resources.

Constant Value: "application/vnd.google-apps.folder"

Public Methods

public abstract PendingResult<DriveFolder.DriveFileResult> createFile (GoogleApiClient apiClient, MetadataChangeSet changeSet, Contents contents)

Creates a new binary file within this folder, with the provided initial metadata and contents. See DriveFile for more details on binary files.

Parameters
apiClient The GoogleApiClient to service the call. The client must be connected before invoking this method.
changeSet A set of metadata fields that should be initially set. This should minimally include a title and mime type.
contents The initial contents.
Returns
  • A PendingResult which can be used to retrieve the newly created DriveFile.

public abstract PendingResult<DriveFolder.DriveFolderResult> createFolder (GoogleApiClient apiClient, MetadataChangeSet changeSet)

Creates a new folder within this folder, with the provided initial metadata.

Parameters
apiClient The GoogleApiClient to service the call. The client must be connected before invoking this method.
changeSet A set of metadata fields that should be initially set. This should minimally include a title. The mime type will be set to the folder mime type.
Returns
  • A PendingResult which can be used to retrieve the newly created DriveFile.

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

Retrieves a collection of metadata for the direct children of this folder. The result will include metadata for both files and folders.

Parameters
apiClient The GoogleApiClient to service the call.
Returns
  • a PendingResult which can be used to retrieve the children list.

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

Retrieves a collection of metadata for the all authorized direct children of this folder. Unless restricted by the query, the result will include metadata for both files and folders.

Parameters
apiClient The GoogleApiClient to service the call.
query A query that will restrict the results of the retrieved children.
Returns
  • a PendingResult which can be used to retrieve the children list.