Update AAF loading procedure
[dmaap/datarouter.git] / datarouter-node / src / main / java / org / onap / dmaap / datarouter / node / Delivery.java
index 4675081..83d5186 100644 (file)
@@ -168,7 +168,9 @@ public class Delivery {
                 }
             }
             try {
-                Files.delete(sxf.toPath());  // won't if anything still in it
+                if (sxf.list().length == 0) {
+                    Files.delete(sxf.toPath());  // won't if anything still in it
+                }
             } catch (IOException e) {
                 logger.error("Failed to delete file: " + sxf.getPath(), e);
             }