I want to copy a file from one folder to another using java , but the second folder contains a file which has the same name as the file I want to copy.
So how would I do this?
I tried to rename the file after I copy it but this didn't work and the file didn't even appear. Please suggestions!
I was trying to copy using this line of code
FileUtils.copyFileToDirectory(newFile, dir);