Remove temp file if Minio-upload failed
[sdc.git] / openecomp-be / backend / openecomp-sdc-vendor-software-product-manager / src / main / java / org / openecomp / sdc / vendorsoftwareproduct / security / SecurityManager.java
index f16467f..663801b 100644 (file)
@@ -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);
+            }
         }
     }