List files recursively

The following groovy example shows how to recursively list all *.txt files in a directory.

new File("test").eachDirRecurse() { dir ->
	dir.eachFileMatch(~/.*.txt/) { file ->
		println file.getPath()
	}
}
test\bar\bar.txt
test\foo\foo.txt
test\foo\sub\sub.txt