cos下载流关闭处理
This commit is contained in:
+7
-3
@@ -615,13 +615,17 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
return sheetsList;
|
||||
}
|
||||
|
||||
private void downLoadFileList(List<OSSFile> fileTemplateList,String fileNowPath) throws IOException {
|
||||
private void downLoadFileList(List<OSSFile> fileTemplateList,String fileNowPath) {
|
||||
for(OSSFile fileExportDto : fileTemplateList){
|
||||
String oldPath = fileExportDto.getUrl();
|
||||
String newPath = fileNowPath + File.separator + fileExportDto.getFileName();
|
||||
if (CosBootUtil.doesObjectExist(oldPath)){
|
||||
InputStream in = CosBootUtil.download(oldPath);
|
||||
copyFile(in, newPath);
|
||||
try (InputStream in = CosBootUtil.download(oldPath);) {
|
||||
copyFile(in, newPath);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user