删除上传的工程文件。
This commit is contained in:
parent
c6dcd99afb
commit
95a82bb69c
|
|
@ -1565,12 +1565,15 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
|||
}
|
||||
|
||||
private void updateImportPrj2FileSystem(MultipartFile file, String prjId) throws IOException {
|
||||
String tmpZipFile = null;
|
||||
String destDir = null;
|
||||
try {
|
||||
String orgName = file.getOriginalFilename();
|
||||
String tmpZipFile = elePropertyConfig.getEleTmpPath() + File.separator + orgName;
|
||||
tmpZipFile = elePropertyConfig.getEleTmpPath() + File.separator + orgName;
|
||||
String mainName = FileUtil.mainName(orgName);
|
||||
FileUtil.del(tmpZipFile);
|
||||
FileUtil.writeFromStream(file.getInputStream(), tmpZipFile);
|
||||
String destDir = elePropertyConfig.getEleTmpPath() + File.separator + IdUtil.fastSimpleUUID();
|
||||
destDir = elePropertyConfig.getEleTmpPath() + File.separator + IdUtil.fastSimpleUUID();
|
||||
try {
|
||||
ZipUtil.unzip(tmpZipFile, destDir, StandardCharsets.UTF_8);
|
||||
} catch (Exception e) {
|
||||
|
|
@ -1629,6 +1632,13 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
|||
EleCommonUtil.encryptFile(destPath, SecureUtil.aes(FILE_SEC_PASSWD.getBytes()));
|
||||
UserThreadLocal.setSuccessInfo(newEdFileInfo.getParentId(), newEdFileInfo.getId(), "解析导入的工程文件成功,导入的工程名为 {},文件名为 {}", orgName, importFile.getName());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
String info = "上传失败,原因 " + e.getMessage();
|
||||
throw new BizException(info, e);
|
||||
} finally {
|
||||
FileUtil.del(destDir);
|
||||
FileUtil.del(tmpZipFile);
|
||||
}
|
||||
}
|
||||
|
||||
private String updateImportPrj2Db(MultipartFile file) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue