Dropbox API v2 files_list_folder [英] Dropbox API v2 files_list_folder
问题描述
在dropbox.github.io/dropbox-api-v2-explorer/#files_list_folder上查看list_folder沙箱
Looking at the list_folder sandbox at dropbox.github.io/dropbox-api-v2-explorer/#files_list_folder
-
我找不到只返回文件夹的方法-基本上在其中".tag" ="folder"-我将所有文件夹和文件都放在一个巨大的块中,必须解析出"folders"
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"
无法轻松地将嵌套文件夹解析为某种逻辑方式,因此我可以在列表中显示带有缩进的子文件夹的列表.例如家长ID,有助于与孩子和孩子配对.父文件夹
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
没有排序功能,例如以名称或创建的ASC/DESC顺序返回的名称"创建"
no sorting features, such as 'name' 'created' to return them in name or created ASC/DESC order
有帮助吗?
推荐答案
我能想到的最好的解决方案是仅取回文件夹.似乎当您为特定的路径"执行"2/files/list_folder"并将所有选项设置为false时.当您收到数据时,请遍历寻找.tag =="folder"并收集它们.如果发现不是.tag =="folder"的项目,则可以停止,您已经为指定的"path"收集了所有文件夹.无需执行"2/files/list_folder/continue".尽管它不能解决我的所有问题,但对于解决我的文件夹加载/搜索时间肯定可以走很长的路.
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.
这篇关于Dropbox API v2 files_list_folder的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!