Click or drag to resize

FilesUserRoutesListFolderAsync Method (String, Boolean, Boolean, Boolean, Boolean, Boolean, NullableUInt32, SharedLink, TemplateFilterBase, Boolean)

Starts returning the contents of a folder. If the result's HasMore field is true, call ListFolderContinueAsync(ListFolderContinueArg) with the returned Cursor to retrieve more entries.

If you're using Recursive set to true to keep a local cache of the contents of a Dropbox account, iterate through each entry in order and process them as follows to keep your local state in sync:

For each FileMetadata, store the new entry at the given path in your local state. If the required parent folders don't exist yet, create them. If there's already something else at the given path, replace it and remove all its children.

For each FolderMetadata, store the new entry at the given path in your local state. If the required parent folders don't exist yet, create them. If there's already something else at the given path, replace it but leave the children as they are. Check the new entry's [!:Dropbox.Api.Files.FolderSharingInfo.ReadOnly] and set all its children's read-only statuses to match.

For each DeletedMetadata, if your local state has something at the given path, remove it and all its children. If there's nothing at the given path, ignore this entry.

Note: RateLimitError may be returned if multiple ListFolderAsync(ListFolderArg) or ListFolderContinueAsync(ListFolderContinueArg) calls with same parameters are made simultaneously by same API app for same user. If your app implements retry logic, please hold off the retry until the previous request finishes.

Namespace:  Dropbox.Api.Files.Routes
Assembly:  Dropbox.Api (in Dropbox.Api.dll) Version: 5.0
Syntax
public Task<ListFolderResult> ListFolderAsync(
	string path,
	bool recursive = false,
	bool includeMediaInfo = false,
	bool includeDeleted = false,
	bool includeHasExplicitSharedMembers = false,
	bool includeMountedFolders = true,
	Nullable<uint> limit = null,
	SharedLink sharedLink = null,
	TemplateFilterBase includePropertyGroups = null,
	bool includeNonDownloadableFiles = true
)

Parameters

path
Type: SystemString
A unique identifier for the file.
recursive (Optional)
Type: SystemBoolean
If true, the list folder operation will be applied recursively to all subfolders and the response will contain contents of all subfolders.
includeMediaInfo (Optional)
Type: SystemBoolean
If true, MediaInfo is set for photo and video. This parameter will no longer have an effect starting December 2, 2019.
includeDeleted (Optional)
Type: SystemBoolean
If true, the results will include entries for files and folders that used to exist but were deleted.
includeHasExplicitSharedMembers (Optional)
Type: SystemBoolean
If true, the results will include a flag for each file indicating whether or not that file has any explicit members.
includeMountedFolders (Optional)
Type: SystemBoolean
If true, the results will include entries under mounted folders which includes app folder, shared folder and team folder.
limit (Optional)
Type: SystemNullableUInt32
The maximum number of results to return per request. Note: This is an approximate number and there can be slightly more entries returned in some cases.
sharedLink (Optional)
Type: Dropbox.Api.FilesSharedLink
A shared link to list the contents of. If the link is password-protected, the password must be provided. If this field is present, Path will be relative to root of the shared link. Only non-recursive mode is supported for shared link.
includePropertyGroups (Optional)
Type: Dropbox.Api.FilePropertiesTemplateFilterBase
If set to a valid list of template IDs, PropertyGroups is set if there exists property data associated with the file and each of the listed templates.
includeNonDownloadableFiles (Optional)
Type: SystemBoolean
If true, include files that are not downloadable, i.e. Google Docs.

Return Value

Type: TaskListFolderResult
The task that represents the asynchronous send operation. The TResult parameter contains the response from the server.
Exceptions
See Also