Forum Discussion

Vartika A.'s avatar
Vartika A.
New member | Level 1
11 years ago

Unable to download/delete files using File Id in Java API v2

I am trying the to download/delete the file using unique Ids but I am getting error saying ----- "String 'path' does not match pattern"

Following is the code snippet :

FileOutputStream out = new FileOutputStream("/home/vartika/Desktop/abc.jpg");
try {
FileMetadata downloadedFile = dbxClient.files.downloadBuilder("id:qQTA507FJn8AAAAAAAAAMA").run(out);
System.out.println("Metadata: " + downloadedFile.name);

}
finally {
out.close();
}

 

Can you please guide me through it ?

1 Reply

Replies have been turned off for this discussion
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    11 years ago

    The API v2 Java SDK downloadBuilder doesn't currently support file IDs, so you'll have to a path. I'll be sure to pass this along as a request though.

About Dropbox API Support & Feedback

Node avatar for 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!