Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enumerating folders and files using Google Drive SDK V2

I am a little confused by the v2 Google Drive SDK.

There seems to be 2 methods to retrieve information about files and folders.

files.list and children.list

Using files.list I do not seem to be able to narrow my search to files in a specific folder but using children.list only returns very basic file information such as ID. There are no filenames.

It looks like I have to retrieve a list of children and then perform a request for each child to find out its filename which seems very inefficient.

What is the normal\correct way to enumerate folders and their contents using Google Drive?

like image 824
Kuffs Avatar asked Jun 29 '12 07:06

Kuffs


1 Answers

Alternative approach is to use files.list with a query expression to limit by parent.

q='id-of-parent' in parents 

This will give you the same results as the child collection, but with the full metadata for each item.

like image 125
Steve Bazyl Avatar answered Oct 08 '22 09:10

Steve Bazyl