cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Java API v2 - DeleteError

Java API v2 - DeleteError

Ojstn
New member | Level 2
Go to solution

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

Greg-DB
Dropbox Staff
Go to solution
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

Greg-DB
Dropbox Staff
Go to solution
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...

Ojstn
New member | Level 2
Go to solution
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.

cgirecruitment1
Explorer | Level 4
Go to solution

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
Go to solution
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    cgirecruitment1 Explorer | Level 4
  • User avatar
    Ojstn New member | Level 2
What do Dropbox user levels mean?