所有文件都在MetadataBuffer中,但不包括文件夹。
Tasks.await(driveClient.requestSync());
Query q = new Query.Builder()
.addFilter(Filters.in(SearchableField.PARENTS, rootFolder.getDriveId()))
.addFilter(Filters.eq(SearchableField.TRASHED, false))
.build();
Task<MetadataBuffer> queryTask = driveResourceClient.query(q);
MetadataBuffer query = Tasks.await(queryTask);
for (int i = 0; i < query.getCount(); i++) {
Log.d(TAG, query.get(i).getTitle());
}
如何列出子文件夹?
我已经尝试过.addFilter(Filters.eq(SearchableField.MIME_TYPE,“ application / vnd.google-apps.folder”)),也无法正常工作。.
谢谢