One month down in 2025: How are your resolutions coming along? Check out how to get back on track here.
Forum Discussion
Ojstn
7 years agoNew member | Level 2
Java API v2 - DeleteError
For clarification, I am using the Java API v2 for DropBox for an AndroidStudio project.
I am trying to use the deleteV2(String path) method and keep running into a DeleteErrorException.
Here's the line resulting in the error:
client.files().deleteV2(path);
where path matches the pattern "(/(.|[\\r\\n])* )|(ns:[0-9]+(/. * )?)", as described in the api docs.
The exception returns the following message:
com.dropbox.core.v2.files.DeleteErrorException: Exception in 2/files/delete: {".tag":"path_lookup","path_lookup":"not_found"}
I cannot seem to find any documentation related to this particular issue. I would greatly appreciate it if somebody could help me figure out what I'm doing wrong.
- This 'not_found' error indicates that there is nothing at the specified path (your 'path' variable in this case) in the connected account:
https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/files/LookupError.html#NOT_FOUND
You should fix your path value to specify the correct path string for the file you want to delete. You can get this from Metadata.getPathLower for the Metadata object for the file, for instance:
https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/files/Metadata.html#getPathLower--
You can get file metadata from getMetadata or listFolder, for example:
https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/files/DbxUserFilesRequests.html#getMetadata-java.lang.String-
https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/files/DbxUserFilesRequests.html#listFolder-java.lang.String-
- Greg-DB
Dropbox Staff
This 'not_found' error indicates that there is nothing at the specified path (your 'path' variable in this case) in the connected account:
https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/files/LookupError.html#NOT_FOUND
You should fix your path value to specify the correct path string for the file you want to delete. You can get this from Metadata.getPathLower for the Metadata object for the file, for instance:
https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/files/Metadata.html#getPathLower--
You can get file metadata from getMetadata or listFolder, for example:
https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/files/DbxUserFilesRequests.html#getMetadata-java.lang.String-
https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/files/DbxUserFilesRequests.html#listFolder-java.lang.String-- OjstnNew member | Level 2Thanks. I managed to fix the issue with some trial and error with the path variable, but it's nice to know where to check for explicit path of each item.
- cgirecruitment1Explorer | Level 4
Hello,
I am not able to delete any file using pat as "id:somevalue". Does API support this from java? Since I am able to do it from API Explorer.
- Greg-DB
Dropbox Staff
cgirecruitment1 I see you opened a new thread for this so I'll follow up there: https://www.dropboxforum.com/t5/API-Support-Feedback/Delete-File-delete-path-not-working/m-p/358771#M20440
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,950 PostsLatest Activity: 4 hours ago
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!