Commands: StartsWithAsync
StartsWithAsync can be used to retrieve multiple file headers for the specified prefix name.
Syntax
Task<FileHeader[]> StartsWithAsync(string prefix, string matches, int start, int pageSize);
Parameters | ||
---|---|---|
prefix | string | The prefix that the returned files need to match |
matches | string | Pipe ('|') separated values for which file name (after 'prefix') should be matched ('?' any single character; '*' any characters) |
start | int | The number of files that should be skipped |
pageSize | int | The maximum number of the file headers that will be returned |
Return Value | |
---|---|
Task<FileHeader[]> | A task that represents the asynchronous operation. The task result is the array of FileHeaders . |
Example I
The below code will return 128 results at most for files which names start with /images
.
FileHeader[] images = await store
.AsyncFilesCommands
.StartsWithAsync("/images", null, 0, 128);
Example II
In contrast to the previous example, here only the images which names end with .jpg
will be returned.
FileHeader[] jpgs = await store
.AsyncFilesCommands
.StartsWithAsync("/images", "*.jpg", 0, 128);