diff options
author | 2016-10-22 16:38:24 +0800 | |
---|---|---|
committer | 2016-10-22 16:38:24 +0800 | |
commit | 8ca6e4a8fe05d99849af139705adf413ff77f565 (patch) | |
tree | fb0311acac59fc6f11f28f7c6db3eeff131aefd6 /catalog-core/catalog-mgr/src/main/java | |
parent | dc8bf53ee07a2e14cf282c6c56d88e707f1c540f (diff) |
Delete package from temp directory and HTTP server while parse package failed.
Change-Id: I19fad483b26e36ec8554a5319b1f4b0f616498ea
Issue-id:TOSCA-133
Signed-off-by: nancylizi <li.zi30@zte.com.cn>
Diffstat (limited to 'catalog-core/catalog-mgr/src/main/java')
-rw-r--r-- | catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/wrapper/PackageWrapper.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/wrapper/PackageWrapper.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/wrapper/PackageWrapper.java index 9025523c..43e70919 100644 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/wrapper/PackageWrapper.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/wrapper/PackageWrapper.java @@ -151,6 +151,11 @@ public class PackageWrapper { LOG.info("Package parse success ! serviceTemplateId = " + serviceTemplateId); } catch (Exception e1) { LOG.error("Parse package error ! "); + String packagePath = PackageWrapperUtil.getPackagePath(packageData.getCsarId()); + FileManagerFactory.createFileManager().delete(packagePath); + if (tempDirName != null) { + ToolUtil.deleteDir(new File(tempDirName)); + } PackageManager.getInstance().deletePackage(packateDbData.getCsarId()); throw new Exception(e1); } |