Get all files of a specific type

This snippet shows howto get all *.txt files under the “test” directory.

new File("test").eachFileMatch(~/.*.txt/) { file ->
	println file.getName()
}
test.txt