The Community is undergoing an upgrade and some features may be unavailable. Find out more here.
Forum Discussion
TS L.
5 years agoExplorer | Level 4
TaskListFolderAndAccountId does not list all files in the folder
My app is using TaskListFolderAndAccountId to get the list of files and folders from the root directory. It was working fine and list all the files and folders in the root directory without any probl...
- 5 years ago
Thanks! We'll look into it and follow up with you there.
TS L.
Explorer | Level 4
What I wanted is the list of folder names from the root directory.
When I used the code:
ListFolderResult kListFolderResult = mDbxClient.files().listFolder("")
I got a few files (folder + files) in kListFolderResult. (Please set A below)
When I used the codes:
ListFolderResult kListFolderResult = mDbxClient.files().listFolder("");
while (kListFolderResult.getHasMore() ){
kListFolderResult = mDbxClient.files().listFolderContinue(kListFolderResult.getCursor());
I got more files but not all in the root directory. (Please set B belw)
To get the folder names for kListFolderResult, my codes are as the following:
override fun onDataLoaded(result: ListFolderResult) {
var dbFolderName: String
val files = result.entries
folderNameArray.clear()
for (i in files.indices) {
dbFolderName = files[i].name
//Todo: for check
Log.i("dbFolderName", "dbFolderName: $dbFolderName")
f (files[i] is FolderMetadata) {
folderNameArray.add(dbFolderName)
}
Root direcotry complete folders and files:
FirebaseUI [missing in set B]
Misc [mising in set A]
Camera Uploads [missing in set A]
Screenshots [missing in set A and B]
TSlim [missing in set A]
HawkerHelperApk [missing in set A]
HawkerHelperKeyAPK [missing in set B]
MyFamilyData2Code4Name1.4 [missing in set A]
our music [missing in set A]
MyFamilyData2Code2Name1.3.1 [missing in set A]
FamilyTreeSampleData [missing in set A]
PeopleIcon [missing in set A]
Screenshots [missing in set A and B]
FamilyTree Error [missing in set A]
Family Tree backup [missing in set A]
hhelper [missing in set A]
FamilyTreeAPK [missing in set A]
MyFamilyData1Code4Name1.2 [missing in set A and B]
famtree video [missing in set A]
photoDropbox [missing in set A]
Tree [missing in set A]
ApkPhotoStory [missing in set A]
famtreeAACMWa2kNcibCNAJ6nXPFVO95u4nndLjcLwzs [missing in set A
Asssxx.MyFamily20200927_191839 [missing in set A]
famtreeABCMWa2kNcibCNAJ6nXPFVO95u4nndLjcLwzs [missing in set A]
LTS002.MyFamily20180427_153445 [missing in set B]
LTS003.MyFamily20180429_163755 [missing in set B]
LTS001.MyFamily20180419_202734 [missing in set B]
LTS4xx.MyFamily20180608_181400 [missing in set B]
LTS005.MyFamily20180622_061054 [missing in set B]
app-debug.apk [missing in set A] (note: this is a file, the rest shown above are folders)
Set A folders and files:
InvestcomAPK
HawkerHelperKeyAPK
MyFamilyKeyAPK
FirebaseUI
HawkerPOS_APK
MyFamilyBackUp
LTS002.MyFamily20180427_153445
LTS003.MyFamily20180429_163755
LTS001.MyFamily20180419_202734
LTS4xx.MyFamily20180608_181400
LTS005.MyFamily20180622_061054
Set B folders and files:
Misc
Camera Uploads
Screenshots
TSlim
HawkerHelperApk
MyFamilyData2Code4Name1.4
our music
MyFamilyData2Code2Name1.3.1
FamilyTreeSampleData
PeopleIcon
FamilyTree Error
Family Tree backup
hhelper
FamilyTreeAPK
famtree video
photoDropbox
Tree
ApkPhotoStory
famtreeAACMWa2kNcibCNAJ6nXPFVO95u4nndLjcLwzs
Asssxx.MyFamily20200927_191839
famtreeABCMWa2kNcibCNAJ6nXPFVO95u4nndLjcLwzs
app-debug.apk
Greg-DB
5 years agoDropbox Staff
Listing a folder (such as root) can take an arbitrary number of calls, so make sure you're aggregating the results from all of the calls.
It's not entirely clear where/when are you actually collecting these result sets. It seems like some of the relevant code may be missing here, but looking at the code you shared, it looks like you may only be collecting the last page, since you're doing folderNameArray.clear() each time.
- TS L.5 years agoExplorer | Level 4
The root direcotry complete folders and files are from my Dropbox root folder. Set A and B are getting from the code Log.i("dbFolderName", "dbFolderName: $dbFolderName") when iterating in
for (i in files.indices) loop.I tested again by removing the line folderNameArray.clear(). It gave the same results of A and B as before.
Note: I added the line folderNameArray.clear() is to have a clean set before iterating the result.entries with the for(i in files.indices) loop.
- Greg-DB5 years agoDropbox Staff
Thanks for the information. It's unclear from this what the issue is then. Could you open an API ticket so we can take a closer look? Please include the full responses that you're getting, without any processing. That is, show what you're getting back in all of the ListFolderResult objects from all of the calls to listFolder and listFolderContinue without any extra handling so we can see the results and cursors. Thanks!
- TS L.5 years agoExplorer | Level 4
API tiket openned.
Ticket #11426113: API: listFolder not retrieving all folders and files at root directory.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,874 PostsLatest Activity: 9 hours agoIf 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!