I need to copy a file in Groovy and saw some ways to achieve it on the web:
1
new AntBuilder().copy( file:\"$sourceFile.canonicalPath\",
If it is a text file, I would go with:
def src = new File('src.txt') def dst = new File('dst.txt') dst << src.text