diff options
author | vasraz <vasyl.razinkov@est.tech> | 2022-10-26 14:00:08 +0100 |
---|---|---|
committer | Michael Morris <michael.morris@est.tech> | 2022-10-27 12:02:27 +0000 |
commit | f22f815d5c4e5d89049c6bbab781fec27ed1b894 (patch) | |
tree | 57dbd55a3f916443d1d8888abba804b208fdd1c7 /openecomp-be/backend/openecomp-sdc-vendor-software-product-manager | |
parent | 813ac1c0dfa0f5c90210407c93d98076c86fc9ef (diff) |
Remove temp file if Minio-upload failed
Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech>
Change-Id: Ib30f2b4643974c838d003db39c616fa82021cc6e
Issue-ID: SDC-4232
Diffstat (limited to 'openecomp-be/backend/openecomp-sdc-vendor-software-product-manager')
-rw-r--r-- | openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/security/SecurityManager.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/security/SecurityManager.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/security/SecurityManager.java index f16467f568..663801bd8e 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/security/SecurityManager.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/security/SecurityManager.java @@ -233,10 +233,12 @@ public class SecurityManager { } private void deleteFile(final Path filePath) { - try { - Files.delete(filePath); - } catch (final IOException e) { - LOGGER.warn("Failed to delete '{}' after verifying package signed data", filePath, e); + if (Files.exists(filePath)) { + try { + Files.delete(filePath); + } catch (final IOException e) { + LOGGER.warn("Failed to delete '{}' after verifying package signed data", filePath, e); + } } } |