标签:import app groovy methods sys nes port delete join
转自: http://atobs.blogspot.fr/2012/08/match-only-files-that-match-pattern-in.html#!/2012/08/match-only-files-that-match-pattern-in.html
Groovy:
In Groovy we can use the eachDirRecurse and eachFileMatch() methods to get all the file names displayed.
def pattern = ~/.*\.java/
def dirname="/usr/local/mysource"
new File("$dirname").eachDirRecurse { dir ->
dir.eachFileMatch(pattern) { myfile ->
println "$myfile"
} // eachFileMatch
} // eachFileMatch
Match files that match pattern in Groovy and Python
标签:import app groovy methods sys nes port delete join
原文地址:http://www.cnblogs.com/z1500592/p/6020466.html