I am working with Grails. I need to copy a file from one folder to another. Here are my attempts below ::
def wrapAll(){
def uploadList = Upload.findAllByIsWrapped(false)
if (uploadList){
uploadList.each {
def dist = new Dist(it.properties)
dist.filePath = it.filePath.replace("upload","dist")
def file = new File(it.filePath)
}
}
}
here it.filePath = web-app/apps/upload/test_txt_file.txt and dist.filePath = web-app/apps/dist/test_txt_file.txt
I want that first file will be copied in second location.