public static void consumeListFileExport(String sourceFilePath,
String destFilePath) throws IOException {
File src = new File(sourceFilePath);
if ((src.exists()) && (src.canRead())) {
File dest = new File(destFilePath);
try {
FileUtils.copyFile(src, dest);
} catch (IOException e) {
throw new IOException("文件拷贝异常: " + e);
}
} else {
throw new RuntimeException("源文件不存在或者不可读: " + sourceFilePath);
}
Common IO在项目中的应用
最新推荐文章于 2022-05-23 09:34:29 发布