| java.lang.Object | ||
| ↳ | com.google.android.gms.drive.metadata.MetadataField<T> | |
| ↳ | com.google.android.gms.drive.metadata.CollectionMetadataField<T> | |
A metadata field which holds a collection of values. Instances of this class (such as the static
values in SearchableField) can be used to create
"in" filters for file queries.
For example, the following code will find all files in the folder with ID "folder" with the MIME type "text/plain":
DriveId parent = DriveId.createFromResourceId("folder");
Filter parentFilter = Filters.in(SearchableField.PARENTS, parent);
Filter mimeTypeFilter = Filters.eq(SearchableField.MIME_TYPE, "text/plain");
Query query = new Query.Builder().addFilters(parentFilter, mimeTypeFilter).build();
for (Metadata metadata : Drive.DriveApi.query(apiClient, query).await().getMetadataBuffer()) {
System.out.println(metadata.getTitle());
}
Note that you must pass a CollectionMetadataField to the Filters.in method;
a plain MetadataField cannot be used as part of an "in" query. However, every
CollectionMetadataField is also a MetadataField, so you can use a
CollectionMetadataField with Filters.eq (for example, if you want to find a
file with an exact set of parents).
|
[Expand]
Inherited Methods | |||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.android.gms.drive.metadata.MetadataField
| |||||||||||||||||||||||||||||||||
From class
java.lang.Object
| |||||||||||||||||||||||||||||||||