List all directories with a specific name

This groovy snippet lists all directories named “bar” in the “test” directory.

new File("test").eachDirMatch("bar") { dir ->
	println dir.getPath()
}
test\bar