我正在尝试将文件从一个文件夹复制到另一个文件夹。
这是我的代码中的内容:
public static void copyFile(String path) throws IOException{
newPath = path;
File destination = new File ("E:/QA/chart.js");
FileUtils.copyFile(destination, new File(newPath));
}
但它没有将所需的文件复制到其位置。
需要什么,其副本chart.js从E盘复制到newPath可变位置。
还有其他方法可以将文件从一个地方复制到另一个地方吗?
您可以使用标准java.nio.file.Files.copy(Path source, Path target, CopyOption... options)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)