0
我一直在测试列表文件API(仍然使用开发帐户,也许这是问题的一部分?),但看到意外的结果。基本上,我问路径上的信息,处理结果,然后通过“listFolderGetLatestCursor”询问“新”光标,但它说没有变化。我错过了什么吗?Dropbox API游标:它们有效期和使用时间有多长时间
问:有多长光标有效?
问题:如果我运行一个null
光标在路径/tmp
下面的方法,并预留光标为cursor1
,然后修改文件/tmp
,然后经过1天润与cursor1
同样的方法,找回cursor2
它不显示任何更改。有时,当我以较短的时间间隔运行它时,我似乎会得到预期的结果,但我必须错过一些东西。提前
public String doDropboxWork(String path, String cursor) {
// make request for path
if (cursor == null) {
ListFolderBuilder listFolderBuilder = client.files().listFolderBuilder(path);
result = listFolderBuilder.withRecursive(true).withIncludeDeleted(false).start();
} else {
result = client.files().listFolderContinue(cursor);
}
while (true) {
// ... do work ....
if (!result.getHasMore()) {
break;
}
result = client.files().listFolderContinue(result.getCursor());
}
// get new cursor
String cursor2 = client.files().listFolderGetLatestCursor(path).getCursor();
return cursor2;
}
感谢
[交叉链接以供参考:https://www.dropboxforum.com/hc/en-us/community/posts/208435823-how-long-is-a-cursor-valid-for-] – Greg