Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
I'm looking for the following API's that exist in V1:
1) client.getDelta(deltaCursor)
2) client.createTemporaryDirectUrl(path)
3) client.disableAccessToken()
For the first one, getDelta, it appears this would be equivalent:
ListFolderResult result = client.files().listFolderContinue(deltaCursor);
However, I couldn't tell how to determine if an entry was deleted, the previous API I used DbxEntry.metadata == null.
For 2&3, maybe using the old API is supported still? The only reason I need the new API is to use the file ID support mostly for detecting file renames.
1) Yes, in API v2, you would use listFolder and listFolderContinue instead of getDelta. You should check if each entry is a FileMetadata, FolderMetadata, or DeletedMetadata to distinguish between files, folders, and deleted items, respectively.
2) API v2 doesn't currently have an equivalent of createTemporaryDirectUrl, but I'll be sure to pass this along as a feature request.
3) API v2 also doesn't currently have an equivalent of disableAccessToken, but I'll be sure to pass this along as a feature request too.
And yes, for the functionality without equivalents in API v2, you can continue using v1.
Thanks for the quick response. Having a DeletedMetadata makes sense. I was however surprised that DeletedMetadata doesn't have a getId() for the item being deleted.
Is there an equivalent for "page reset" in V2?
DbxDelta<DbxEntry> page = client.getDelta(deltaCursor);
if (page.reset) {
That's correct, DeletedMetadata doesn't contain a file ID, but we'll consider this a feature request as well.
And yes, listFolderContinue can raise ListFolderContinueErrorException where ListFolderContinueError.RESET would indicate a reset, in which case you should start over with listFolder.
DeletedMetadata.getId() makes more sense to me, fortunately, I have a workaround.
My only issue remaining is compiling with maven while trying to support both versions at the same time, because the SDK names are identical (between 1.8.1 & 2.0.0). A question for the maven forums, on how to allow both to be used.
Unless I misunderstand your scenario, you shouldn't need to include both. The 2.0.0 version also include the API v1 calls that 1.8.1 has. I.e., it contains both DbxClientV1 and DbxClientV2.
Oh.. cool
I see the main thing changed for the V1 API is the exceptions. They convert pretty straight-forward, except for one: DbxException.BadResponse
Is that now ProtocolException?
Also, I was disappointed. When I rename a file it sends a delete followed by an "add". I was expecting the new API to only report a "modify" to the given file id.
Do you mean com.dropbox.core.BadResponseException? Each method should document the exceptions it can through. For example, the new download method can throw IllegalArgumentException, DownloadErrorException, or DbxException. For example, it would throw IllegalArgumentException if a parameter is in the wrong format, e.g., "test.txt" instead of "/test.txt".
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
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!