📜  Java 如何复制文件 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:37.546000             🧑  作者: Mango

代码示例1
var source = new File("src/resources/bugs.txt");
var dest = new File("src/resources/bugs2.txt");

Files.copy(source.toPath(), dest.toPath(), 
           StandardCopyOption.REPLACE_EXISTING);

//Source: http://zetcode.com/java/copyfile/