Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
final DbxClientV2 dbxClient = dropboxService.getDropboxClient(user.getAccessToken()); try { final ListFolderResult listResult = dbxClient.files() .listFolderBuilder(path) .withRecursive(true) .start(); ....
}
Using this piece of code, I get as a result a single folder but in reality that's not the case. This behavior just started to happen today. Up until today, the result contained all files/folders that actually exist in that path... so I was wondering if there is any limit in size or number of files based on which the result object is populated...
The folder I'm trying to list from, contains 3.5K files, with a total of 7GB in size..
I see you're using listFolderBuilder, but aren't calling listFolderContinue. You aren't always guaranteed to get all entries returned by calling just listFolder. You need to check the result, and if ListFolderResult.hasMore is true, call back to listFolderContinue to get more results (and the same for the listFolderContinue result). You can find more information in the listFolder documentation.
Whether or not hasMore actually comes back as true in practice depends on a variety of factors that can change over time, per account, and per path.
I see you're using listFolderBuilder, but aren't calling listFolderContinue. You aren't always guaranteed to get all entries returned by calling just listFolder. You need to check the result, and if ListFolderResult.hasMore is true, call back to listFolderContinue to get more results (and the same for the listFolderContinue result). You can find more information in the listFolder documentation.
Whether or not hasMore actually comes back as true in practice depends on a variety of factors that can change over time, per account, and per path.
hi Greg,
Thanks for your quick reply. Indeed after looping on the .hasMore() i was able to get all my entries. So your suggestion fixed my problem. However, I am curious why did this behavior occur just now, since I've been using the approach you saw in my post for the last 2 years or so and I was getting all the entries in a single call.
-victor
The requirement to use listFolderContinue has always been part of API v2, but the amount of entries you get back per page can vary due to a number of things that can change over time. I can't say exactly what caused the change in this particular case, so just make sure you always have listFolderContinue implemented as documented so you can make sure to get everything.
Ok. Got it. Thanks ! Have a nice day !
-victor
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!