com.google.api.services.drive.model.File.getPermissions() returns null -


com.google.api.services.drive.model.file.getpermissions() returns null instead of list of permission resources if file has permissions. same fileid when used in com.google.api.services.drive.drive.permissions.list(string fileid) returns right list of permissions. hoping avoid second api call permissions, calling getpermissions() on retrieved file object.

does have clue on why getpermissions() returns null ?

i had same problem code:

drive.files().list().execute().getitems() 

it turns out google drive api doesn't, default, information each of files returned.

in case, fixed specifying fields wanted:

final string fields = "items(id,labels/trashed,owners/emailaddress,permissions(emailaddress,name,role),title)"; drive.files().list().setfields(fields).execute().getitems() 

i used "fields editor" near bottom of page create fields string.


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -