You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

Dario_Go's avatar
Dario_Go
Explorer | Level 3
8 years ago

Correct Way to move folders in batch mode Java API

Hi. I need to move a lot of folders with files to another shared folder. I need to do that every day using Java API   But moving a got the messsage "too_many_write_operations". I read in the doc th...
  • Greg-DB's avatar
    8 years ago

    To move items in bulk using the Dropbox API v2 Java SDK, you should use moveBatch (or moveBatchBuilder) and moveBatchCheck.

     

    We don't have a full example of that, but it would look like this:

     

    List<RelocationPath> entries = new ArrayList<RelocationPath>();
    entries.add(new RelocationPath("/folder1_original_path", "/folder1_new_path"));
    entries.add(new RelocationPath("/folder2_original_path", "/folder2_new_path"));
    // ... and so on
    
    RelocationBatchLaunch moveBatchJob = client.files().moveBatch(entries);
    
    RelocationBatchJobStatus moveBatchCheck = null;
    
    while (moveBatchCheck == null || moveBatchCheck.isInProgress()) {
        // check this occasionally until it's done
        moveBatchCheck = client.files().moveBatchCheck(moveBatchJob.getAsyncJobIdValue());
        System.out.println(moveBatchCheck);
        Thread.sleep(10000);
    }

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,912 PostsLatest Activity: 2 days ago
333 Following

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 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!