Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
Dan R.23
10 years agoNew member | Level 1
Delete a file using Java api v2
How do I delete a file using the java api v2. I found DeleteArg, but it doesn't seem to do any thing??? Thanks.
- 10 years ago
Hi Dan, you can use the delete method in DbxUserFilesRequests. For example:
Metadata metadata = client.files().delete(path);
Hope this helps!
MarcoLI
9 years agoNew member | Level 2
Hy!
When I try to run my code it displays the following error:
"Exception in thread "Thread-2" java.lang.NoSuchMethodError: com.dropbox.core.DbxHost.getApi()Ljava/lang/String; at com.dropbox.core.v2.files.DbxUserFilesRequests.delete(DbxUserFilesRequests.java:218) at com.dropbox.core.v2.files.DbxUserFilesRequests.delete(DbxUserFilesRequests.java:248)"
My code:
public Metadata delete(String path) throws DeleteErrorException, DbxException{
Metadata metadata = null;
DbxRequestConfig config = new DbxRequestConfig(
"JavaTutorial/1.0", Locale.getDefault().toString());
try{
//DbxHost DEFAULT = new DbxHost("api.dropboxapi.com","content.dropboxapi.com","www.dropbox.com","notify.dropboxapi.com");
DbxClientV2 cli = new DbxClientV2(config, "<REDACTED>", DbxHost.Default);
metadata = cli.files().delete(path);
cli.files().delete(path);
JOptionPane.showMessageDialog(null, "apagado");
}catch(DbxException | HeadlessException erro){
JOptionPane.showMessageDialog(null, erro);
}
return metadata;
}
wei-qiang
9 years agoNew member | Level 2
hi i've got the same issue have you found a solution yet?
- Greg-DB9 years ago
Dropbox Community Moderator
wei-qiang We'll be happy to help with whatever issues you're having with the Dropbox API. Please feel free to open a new thread with the relevant code and the full error/output you're getting:
https://www.dropboxforum.com/t5/forums/postpage/board-id/101000014
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!