The DirectoryReaderSync interface of the FileSystem API lets a user list files and directories in a directory.
DirectoryReaderSync