Official documentation: http://docs.groovy-lang.org/latest/html/groovy-jdk/java/io/File.html
Common Method:
1. eachFile(File self, Closure closure):Invokes the closure for each ‘child’ file or directory in this ‘parent’ folder/directory.
class eachDirTest {
public static void main(String[] args) {
def dir = new File("D:\\Project\\SoapUI\\Project-smoke-tests")
dir.eachFile{file ->
println file
}
}
}
2. eachFile(File self, FileType fileType, Closure closure): Invokes the closure for