Hello I am using groovy 2.1.5 and I have to write a code which show the contens/files of a directory with a given path then it makes a backup of the file and replace a word/
other simple solution would be following closure:
def replace = { File source, String toSearch, String replacement -> source.write(source.text.replaceAll(toSearch, replacement)) }