getFeed doesn't return all associated feeds?

69 views
Skip to first unread message

huffie

unread,
Mar 30, 2012, 10:07:13 PM3/30/12
to google-docum...@googlegroups.com
Based on Google docs web UI, under a "folder" I have 110 files, but when I tried using DocsService service.getFeed(url, DocumentListFeed.class), it returns only 98 files?
I have used the sample code to retrieve the feed 
URL url = buildUrl(URL_DEFAULT + URL_DOCLIST_FEED + "/" + folderResourceId + URL_FOLDERS);
return service.getFeed(url, DocumentListFeed.class);

and initially, I thought was some error due to the URL.. hence I modified to 
URL url = new URL(((MediaContent) entry.getContent()).getUri());   //where entry is DocumentListEntry class
return service.getFeed(url, DocumentListFeed.class);

both would return the same thing, 98 files only. Any advise how I should go about doing it? Thanks!
btw, I uploaded the files using ResumableGDataFileUploader code sample.

Claudio Cherubino

unread,
Apr 2, 2012, 10:47:24 AM4/2/12
to google-docum...@googlegroups.com

Hi,

Is it possible that some of those elements in the folder are trashed or folders themselves?

To retrieve them, you have to specify the showdeleted or showfolders parameter respectively:

https://developers.google.com/google-apps/documents-list/#getting_a_list_of_documents_and_files

Claudio

huffie

unread,
Apr 2, 2012, 8:54:33 PM4/2/12
to google-docum...@googlegroups.com
Hi Claudio,
    I doubt those elements are trashed or folders as I've uploaded and checked using Web browsers and they are there. I've managed to find an alternative but I don't understand why such behaviour. I've implemented using DocumentQuery instead, my code are as follow:
                  DocumentQuery query = new DocumentQuery(url);
 query.setMaxResults(500); 
                  return service.getFeed(query, DocumentListFeed.class);

I have to specifically specify a max result, otherwise using default max result value (which is -1) will also returned me 98 files. I have yet to test out with other values of max result but intention was to set an amount which I don't think I will exceed. 

TIA!

regards
huffie
Reply all
Reply to author
Forward
0 new messages