Copy multiple files where destination is resolved at runtime

I’m trying to copy files from repository using a loop of my configrations. The files needs to be copied to different directories and the destination path is being created at runtime. The issue is only files in last directories are created. I assume last directory is overwriting all previous directories, so they are never created. Using below in loop

def detinationfolder = new File( var1+var2)
into detinationfolder