cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Update: Find information on Dropbox support during COVID-19 here
Close
cancel
Showing results for 
Search instead for 
Did you mean: 

Java API v2 - DeleteError

Ojstn New member | Level 2
New member | Level 2

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. 

1 Accepted Solution

Accepted Solutions

Re: Java API v2 - DeleteError

Dropboxer
Dropboxer
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.htm...

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#g...

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/DbxUserFilesReq...
https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/files/DbxUserFilesReq...

View solution in original post

4 Replies 4

Re: Java API v2 - DeleteError

Dropboxer
Dropboxer
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.htm...

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#g...

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/DbxUserFilesReq...
https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/files/DbxUserFilesReq...

View solution in original post

Re: Java API v2 - DeleteError

Ojstn New member | Level 2
New member | Level 2
Thanks. 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.

Re: Java API v2 - DeleteError

cgirecruitment1
Explorer | 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.

Re: Java API v2 - DeleteError

Dropboxer
Dropboxer

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?