Stay organized with collections Save and categorize content based on your preferences.
public interface SortableMetadataField implements MetadataField<T>

Interface for metadata fields that can be used to sort results of the file queries. Implementation of this interface (such as the static values in SortableField) can be add sorting criteria for the file or folder queries.

For example, the following code will find all files that are starred, have the MIME type type "text/plain" and list them in the order they were created:

 Filter starredFilter = Filters.eq(SearchableField.STARRED, true);
 Filter mimeTypeFilter = Filters.eq(SearchableField.MIME_TYPE, "text/plain");
 Query query = new Query.Builder()
                        .addFilters(starredFilter, mimeTypeFilter)
 for (Metadata metadata : Drive.DriveApi.query(apiClient, query).await().getMetadataBuffer()) {