One month down in 2025: How are your resolutions coming along? Check out how to get back on track here.
Forum Discussion
SparkyNZ
8 years agoHelpful | Level 5
Listing subfolders with Java api v2
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;
- SparkyNZHelpful | 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.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,941 PostsLatest Activity: 9 hours ago
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!