We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
Ashish_Bijlwan
5 years agoExplorer | Level 4
Pagination in dropbox
Hi,
In dropbox, under an "image" folder we have 100 images and those images we are retrieving from the dropbox and showing in the app using dropbox API. The concern here is that it is taking a lot ...
Ashish_Bijlwan
5 years agoExplorer | Level 4
Thanks for your replay Greg-DB .......
I am using the dropbox Java SDK and in that, I am using listFolder(String Path) method to get the list of images(files). Can we get the files as a paginated way means first 5 files then next 5 and so on...
Thanks and Regards
Ashish
Greg-DB
Dropbox Community Moderator
5 years agoYes, in the Dropbox API v2 Java SDK, the corresponding methods are listFolder, listFolderBuilder, and listFolderContinue.
You can use listFolderBuilder to get a ListFolderBuilder so you can use ListFolderBuilder.withLimit to set the desired approximate page size limit, and then page through using ListFolderBuilder.start and listFolderContinue.
- Ashish_Bijlwan5 years agoExplorer | Level 4
Hi Greg-DB
Whenever i am using the ListFolderBuilder.start and listFolderContinue methods from javasdk to get the content as a pagination then I am not getting the content as sequentially.
Ex : In Dropbox , Inside the "Image" folder, I have uploaded 10 images. Whenever I am retrieving those image from Dropbox using ListFolderBuilder.start and listFolderContinue methods with the limit of 4 then sometimes Initially I am getting the image5,image6,image7,image8 then image1,image2,image3,image4 then image9,image10. Its not in the sequence like its there in the Dropbox.The sequence/order of the uploaded images are in the Dropbox :
image1.png
image2.png
image3.png
..........
..........
image10.pngis there anything I am missing in my code?
Thanks and Regards
Ashish
- Greg-DB5 years ago
Dropbox Community Moderator
The listFolder functionality does not guarantee a particular ordering or offer options for controlling the order of the returned entries. You should retrieve all of the entries and then apply whatever sorting you want client-side.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
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!