cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Are you interested in learning how media industry leaders use Dropbox Replay? Register for our webinar 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: 

Finding if Metadata is for file or folder

Finding if Metadata is for file or folder

Eric J.12
Explorer | Level 4

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

Greg-DB
Dropbox Staff

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...

Eric J.12
Explorer | Level 4

Thanks for the quick response!

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Eric J.12 Explorer | Level 4
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?