Hi,
With Java Sdk V1 I was able to do build a list of my own type of objects based only on the files I was finding in a dropbox path:
List<DbxEntry> dbxEntries = dbxClient.searchFileAndFolderNames(path, query);
for (DbxEntry child : dbxEntries)
{
if (child.isFile())
{
StorageFileImpl i = new StorageFileImpl();
i.setName(child.name);
i.setPath(child.path);
i.setCreationDate(child.asFile().lastModified);
result.add(i);
}
}
I'm trying to do the same thing with Sdk V2.
I've considered 2 options:
1. using files().searchBuilder - but the query param is not helping me at all. I'd like to be able to ignore it or pass empty string as a value for it, but as far as I've tried, that doesn't work..
dbxClient.files().searchBuilder(path, query).withMode(SearchMode.FILENAME).start();
2. using files().listFolderBuilder - but I get entries for folders as well, and I can't exclude them although I saw while debugging that each entry has a file / folder .tag
dbxClient.files().listFolderBuilder(path).withRecursive(true).start();
My code would be the following:
listResult.getEntries().stream()
.forEach(entry -> {
// check it is a file
// ???
StorageFileImpl i = new StorageFileImpl();
i.setName(entry.getName());
i.setPath(entry.getPathDisplay());
// i.setCreationDate(entry.notYetAvailable());
result.add(i);
});
How can I keep only the file .tag type entries ?
Or what other options do I have ?
thanks,
-victor