Groovy: listing the content of a directory, traversing a directory tree
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 }
Published on 2018-06-03
If you have any comments or questions, feel free to post them on the source of this page in GitHub. Source on GitHub.
Comment on this post