//original file
Path original = Paths.get("C:\\Users\\Laksahan\Desktop\\bg.jpg");
File f = new File("C:\\Users\\Laksahan\\Desktop\\bg.jpg");
// new file
Path destination = Paths.get("C:\\Program Files\\Tour v0.1\\image\\"+f.getName());
try {
Files.copy(original, destination, LinkOption.NOFOLLOW_LINKS);
} catch (IOException x) {
x.printStackTrace();
}
我试过上面的方法来复制文件,它不会工作,它会打印这个错误
java.nio.file.NoSuchFileException: C:\Users\Laksahan\Desktop\bg.jpg -> C:\Program Files\Tour v0.1\image\bg.jpg
请帮忙