Dropbox API v2 files_list_folder

吃可爱长大的小学妹 提交于 2019-12-12 03:48:00

问题


Looking at the list_folder sandbox at dropbox.github.io/dropbox-api-v2-explorer/#files_list_folder

  1. I find no way to just return just the folders - basically where ".tag" = "folder" - I get all folders and files in one huge hunk the have to parse out the "folders"

  2. There is no way to easily parse the nested folders into some logical way so I can display a list with the sub folders indented in a display. such as Parent ID's would be helpful to match up children & parent folders

  3. no sorting features, such as 'name' 'created' to return them in name or created ASC/DESC order

Any help?


回答1:


Best solution I could come up with to get only the folders back was this. It seems that when you perform a "2/files/list_folder" for a specific "path" and set all options to false. When you receive data back, iterate through the looking for .tag == "folder" and collect them. If you find an item that is not .tag == "folder", you can stop, you've collected all the folders for you specified "path". No need to perform a "2/files/list_folder/continue". Though it doesn't solve all my issues, this certainly goes a long way to solving my loading/searching time for folders.



来源:https://stackoverflow.com/questions/38405366/dropbox-api-v2-files-list-folder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!