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!
Greg-DB
Dropbox Community Moderator
10 years agoHi Dan, you can use the delete method in DbxUserFilesRequests. For example:
Metadata metadata = client.files().delete(path);
Hope this helps!
cgirecruitment1
7 years agoExplorer | Level 4
Hi Greg,
I am not able to use the same "delete" method using Dropbox V2 API.
Error:
Unknown error occured :String 'path' does not match pattern
I am getting this error, when i pass path as "id:somevalue" , whereas same is working from Dropbox API Explorer.
- Greg-DB7 years ago
Dropbox Community Moderator
cgirecruitment1 You should be able to use the delete method with file IDs. Can you share the actual code and path parameter value you're using that's resulting in this error? Thanks in advance!
- cgirecruitment17 years agoExplorer | Level 4
Yes. My code looks like this:
public String deleteFile(String path)
throws DbxException {DbxRequestConfig requestConfig = DbxRequestConfig.newBuilder("Dropbox Documents Delete").build();
DbxClientV2 client = new DbxClientV2(requestConfig, "AccessToken");FileMetadata fileMetadata = (FileMetadata) client.files().delete(path);
return fileMetadata.getId();
}Path Parameter: id:MWWBdvN6DaAAAAAAAAAAwA
- cgirecruitment17 years agoExplorer | Level 4The Error: String 'path' does not match pattern
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!