Listing all the files and subdirectories in a given path.

Traversing a directory tree sytarting from a specific path.

examples/groovy/directory_listing.groovy

dh = new File('.')
dh.eachFile {
    println(it)
}

examples/groovy/traverse_directory_tree.groovy

dh = new File('.')
dh.eachFileRecurse {
    println it
}