listfiles
.listfiles path:{String} \
directories:{Boolean = true} \
recursive:{Boolean = false} \
pattern:{String? = null} \
fullpath:{Boolean = true} \
sortby:{FileSorting = FileSorting.NONE} \
order:{Ordering = Ordering.ASCENDING}
-> Iterable<String>Content copied to clipboard
Lists the files located in a directory.
Return
a collection of string values, each representing an entry (file or directory) located in the directory. The collection is unordered when sortby is FileSorting.NONE, and ordered otherwise.
Parameters
path
directory path
directories
- Optional
- Likely named
whether to include directories in the listing
recursive
- Optional
- Likely named
whether to recursively list files in nested subdirectories
fullpath
- Optional
- Likely named
whether to return the absolute path of each file, rather than just the file name
sortby
order
See also
to exclude the extension from file names
Throws
if the directory does not exist, is not a directory, or if pattern is not a valid regular expression
Permissions
project-read
to list files located in the project directory
global-read
to list files located outside the project directory