Thanks! First, I see that you're using listFolder to list the contents of folders. That's the correct method, but note that you also need to use listFolderContinue, as you're not guaranteed to get all of the results back in a single call to listFolder. Please review the listFolder documentation for more information.
Anyway, you can't directly control the performance of listFolder, but it looks like you may be calling it more than necessary.
For instance, I see that you're calling it initially here, but are never actually using the result: (at least in the code you shared)
temp = client.files().listFolder("");
If you don't need that call, you should remove it, which would reduce the overall execution time.
Then, I see that you're implementing your own recursive functionality by calling listFolder again for each sub-folder (and so on) here:
ListFolderResult subResult = client.files().listFolder(result.getEntries().get(i).getPathLower());
Depending on your scenario, it may be better to use the Dropbox native 'recursive' listFolder functionality. You can do so by getting a ListFolderBuilder from listFolderBuilder, and calling ListFolderBuilder.withRecursive to set 'recursive' to true. If you use that instead of your initial listFolder call (and subsequent manual recursive calls), Dropbox will automatically give you all of the nested entries. Again though, be sure to read the documentation for information on how to properly implement this.