Need to see if your shared folder is taking up space on your dropbox šŸ‘Øā€šŸ’»? Find out how to check here.

Forum Discussion

Joel T.9's avatar
Joel T.9
New member | Level 2
10 years ago

Java V2 - Equvalent to V1 API's

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.

10 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 years ago

    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.

  • Joel T.9's avatar
    Joel T.9
    New member | Level 2
    10 years ago

    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) {

  • Joel T.9's avatar
    Joel T.9
    New member | Level 2
    10 years ago

    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.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 years ago

    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.

  • Joel T.9's avatar
    Joel T.9
    New member | Level 2
    10 years ago

    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?

  • Joel T.9's avatar
    Joel T.9
    New member | Level 2
    10 years ago

    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.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 years ago

    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". 

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 years ago

    Quick follow up here for anyone looking who hasn't already seen it, the API v2 Java SDK does now have the equivalent of createTemporaryDirectUrl as getTemporaryLink.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

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!