Filename filter
This shows the usage of the Java FilenameFilter with groovy.
(more…)
List filesystem roots
This shows how to use the function in groovy.
(more…)
List directory contents
This lists all files in a directory.
(more…)
Get all files of a specific type
This snippet shows howto get all *.txt files under the “test” directory.
(more…)
List files recursively
This shows how to list all files and directories under the current directory.
(more…)
List all subdirectories
Howto list all subdirectories under the current directory.
(more…)
List directories recursively
The following groovy snippet lists all subdirectories of the current directory.
(more…)
List all directories with a specific name
This groovy snippet lists all directories named “bar” in the “test” directory.
(more…)
List files recursively
The following groovy example shows how to recursively list all *.txt files in a directory.
(more…)
Listing a directory the Java way
List the contents of a directory with groovy using the built in methods of Java. The groovy way is described in the following snippetsList files of a specific type, List directory contents and list files recursively.
(more…)