public class test {
private static void copyGABuild(){
try {
String loc = "C:\\Users\\KAG\\Desktop\\\\test";
Files.copy(Paths.get(loc), Paths.get("C:\\Users\\KAG\\Desktop"));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static void main(String[] args) {
copyGABuild();
}
I am getting this error 'java.nio.file.FileAlreadyExistsException' C:\Users\KAG\Desktop
I dont want to use FileUtils to copy, is there any way I can achieve this using Files. And there is no file inside the directory C:\Users\KAG\Desktop. but it still says FileAlreadyExistsException