|
|
|
|
|
by smt88
671 days ago
|
|
I recently needed something like this (and ended up rolling my own) while using the Dropbox API. There have a fairly conservative rate limit, so you have to think about every API call you make. When traversing, it makes the most sense to do a recursive "ls" of the entire directory tree, keep it in memory, and perform whatever other actions you want (search, list, etc.) on the cached tree. The implementation ended up being a pretty simple IDictionary<string, string[]>, but it would be interesting to try switching to something purpose-built. |
|
I haven't used the Dropbox API myself, but your approach of caching the recursive ls results and then performing actions on the cached tree is very appropriate, especially considering the rate limits. It sounds like a smart way to handle things efficiently.
I’m not sure what types of nodes the Dropbox API provides, but if it’s just files and directories, it could be possible to build a tree in VirtualStorageLibrary based on the cached structure, and then perform reference or search actions. Also, if the Dropbox API has an option to fetch the entire tree structure at once, that would likely be the most efficient approach.
I've prepared an API reference for VirtualStorageLibrary, so feel free to take a look: https://shimodateakira.github.io/VirtualStorageLibrary/api/A...
Please feel free to reach out again if you have any more comments.