cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
We are making some updates so the Community might be down for a few hours on Monday the 11th of November. Apologies for the inconvenience and thank you for your patience. You can find out more 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: 

Re: How to get FileMetaData object representing metadata of a file in Dropbox, using Java SDK?

How to get FileMetaData object representing metadata of a file in Dropbox, using Java SDK?

user44
Explorer | Level 4

In this guide of Dropbox it is nicely explained how to deal with files and folders in Dropbox using their API. But on reaching the endpoint to fetch files and folders in a location using Java SDK instead of list of FileMetaData objects we get MetaData objects which has much less fields for files/folders compare to FileMetaData. Is there a way to get FileMetaData objects instead of MetaData ones directly via API call, using the Java SDK?

 

DbxRequestConfig config = DbxRequestConfig.newBuilder("dropboxClient").build();
DbxClientV2 dbxClient = new DbxClientV2(config, "<access_token>");

ListFolderResult result = dbxClient.files().listFolderContinue("<last_cursor>");
List<MetaData> listMetaData = result.getEntries(); // Is there a way I can get list of FileMetaData objects instead of MetaData.
1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff

Check out the sample here for an example of how to check for and work with the different metadata types in the Java SDK.

View solution in original post

3 Replies 3

Greg-DB
Dropbox Staff

Check out the sample here for an example of how to check for and work with the different metadata types in the Java SDK.

Здравко
Legendary | Level 20

@user44 wrote:

... Is there a way to get FileMetaData objects instead of MetaData ones directly via API call, using the Java SDK?

...


Hi @user44,

The Metadata class is just a basic class that multiple other classes derive from. This class is the common things between FilesMetadata, FolderMetadata, and DeletedMetadata. You never receive Metadata class instance in fact! All the time when you use that interface, it points to an instance of the classes already mentioned. Just a simple check will show you what it actually is. Take a look here for example.

Hope this helps.

user44
Explorer | Level 4

Thanks! 

Need more support?