Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
Dario_Go
9 years agoExplorer | Level 3
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 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); }
2 Replies
- Greg-DB9 years ago
Dropbox Community Moderator
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); } - Dario_Go8 years agoExplorer | Level 3
Thanks!!!
About 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!