Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
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 that we need to do that in batch mode.
Someone have a example to do that?
Thanks in advance.
Regards,
Dario.
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); }
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); }
Thanks!!!
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!