cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Back again with another edition of 'How we use Dropbox', so find out how Emma uses to-do lists to get it all done 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

Re: Finding if Metadata is for file or folder

Greg-DB
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 4

Thanks for the quick response!

Poll
We love to learn from the educators who use Dropbox. Whether you teach kids, teens, adults or a combination of all three, we want to know what apps and integrations you use with Dropbox to help with teaching. Which of the ones below is your favorite, or most used tool?
Who's talking

Top contributors to this post

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