cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox 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: Listing subfolders with Java api v2

Listing subfolders with Java api v2

SparkyNZ
Helpful | Level 5

I am using code such as the snippet below to retrieve file details from Dropbox. How can I tell which entries are folders?

 

I thought there would have been a member in FileMetadata but I am just not seeing it.

 

ListFolderResult result = mDbxClient.files().listFolder("" );

while( true )
{
for( Metadata metadata : result.getEntries() )
{
String sName = metadata.getPathLower();
FileMetadata fileMetadata = (FileMetadata) metadata;

 

1 Reply 1

SparkyNZ
Helpful | Level 5

OK, I found the answer here:

 

https://www.dropboxforum.com/t5/API-support/Get-the-modified-date-for-a-folder-or-file/td-p/184485

 

The short answer is that I need to test metadata with instanceof to see if it is an instance of FolderMetaData or FileMetaData. Java isn't my primary programming language so that was the last thing I would have thought of doing.

Need more support?