ListFiles

fun EventSchemaBuilderScope.ListFiles(id: String = randomId(), trigger: EventTrigger, directory: String, events: EventSchemaBuilderScope.() -> Unit = {})

Lists the files directly inside directory in the client's own file storage; subdirectories and the files inside them are skipped. Does not consume incomingData. Dispatches onSuccess carrying the List<String> of file paths when the directory holds at least one file — each path is relative to the storage root, so it can be passed straight to GetFile/DeleteFiles as fileName; onEmptyDir (no data) when the directory holds no files; onFailure (carrying the Throwable, logged) when the directory doesn't exist (DirNotFoundException) or the listing failed.

Parameters

id

Unique identifier of this event. Defaults to a random id.

trigger

Trigger that fires this event, built via EventTriggers.

directory

Directory to list, relative to the client's file storage root.

events

Child events chained after this one, wired to its triggers (onSuccess, onEmptyDir, onFailure).