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: 

Finding if Metadata is for file or folder

Eric J.12
Explorer | Level 3

Hi,

I am migrating to API v2 and I am using the Java SDK 2.1.1

In v1, there was a way to check if a metadata represented a file or folder. I can't find a method in v2 to get this information. Do you think this could be added? Thank you.

 

2 Replies 2

Re: Finding if Metadata is for file or folder

Dropboxer
Dropboxer

Hi Eric, you can use instanceof to determine if a given Metadata is an instance of FileMetadata, FolderMetadata, or DeletedMetadata and then cast it accordingly, e.g., as shown here:

https://github.com/dropbox/dropbox-sdk-java/blob/3cfa878e5d73f06ed4782c8833b229838fd21472/examples/a...

Re: Finding if Metadata is for file or folder

Eric J.12
Explorer | Level 3

Thanks for the quick response!

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?