I am trying to copy a file using the following code:
File targetFile = new File(targetPath + File.separator + filename); ... targetFile.createNewFile(); file
This can occur when filename has timestamp with colons, eg. myfile_HH:mm:ss.csv Removing colons fixed the issue.
myfile_HH:mm:ss.csv