Friday, July 13, 2012

Groovy: Parse through all xml files in a directory

def folder = <some folder path>
def baseDirectory = new File(folder)
def files = baseDirectory.listFiles().grep(~/.*xml$/)

for (file in files){
      //Do something with the file
}

No comments:

Post a Comment