We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
MateusP
9 years agoHelpful | Level 6
metadata.rev in API v2?
Better late than never, I'm trying to migrate my Android app to API v2. Currently, when downloading a file from a user's linked Dropbox account, I first obtain the file revision... @Override
pro...
- 9 years ago
OK so I worked it out and it's really simple - you just cast to FileMetadata...
FileMetadata metadata = (FileMetadata) mDbxClient.files().getMetadata(mPath+mFilename); String dbxFileRev = metadata.getRev();
If the file is not found, it'll throw a 'FileNotFoundException'
MateusP
9 years agoHelpful | Level 6
OK so I worked it out and it's really simple - you just cast to FileMetadata...
FileMetadata metadata = (FileMetadata) mDbxClient.files().getMetadata(mPath+mFilename); String dbxFileRev = metadata.getRev();
If the file is not found, it'll throw a 'FileNotFoundException'
Greg-DB
Dropbox Community Moderator
9 years agoI'm glad to see you found this already. Yes, some properties are only available on FileMetadata, which is a subclass of Metadata, so you need to cast objects as necessary.
There's an example of how you can check for this here:
About 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!