Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
michal_k
9 years agoExplorer | Level 4
[Java SDK V2] How to find out whether file exists or not
[ Spoiler ] Hello, we are migrating from Java SDK API V1 to Java SDK V2 and I am writing some integration tests. For example, after I delete a file I need to check, that this file is no long...
- 9 years ago
You can access the structured error information like this:
try { client.files().getMetadata(dropboxPath); } catch (GetMetadataErrorException e){ if (e.errorValue.isPath() && e.errorValue.getPathValue().isNotFound()) { System.out.println("File not found."); } else { throw e; } }
Greg-DB
Dropbox Community Moderator
9 years agoYou can access the structured error information like this:
try {
client.files().getMetadata(dropboxPath);
} catch (GetMetadataErrorException e){
if (e.errorValue.isPath() && e.errorValue.getPathValue().isNotFound()) {
System.out.println("File not found.");
} else {
throw e;
}
}About Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.
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!