X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-clustering-commons%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fpersistence%2FLocalSnapshotStore.java;h=62b0cf5bfd061867da72cd4084eb8eec86d72821;hb=5cc558ac2fa4d221e26b76df725bade5b44ee794;hp=76babc15db7d831403e985c658e3a3cef46f3e99;hpb=9ba29cd861d75d328aa67d53726250226dc8e438;p=controller.git diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/persistence/LocalSnapshotStore.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/persistence/LocalSnapshotStore.java index 76babc15db..62b0cf5bfd 100644 --- a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/persistence/LocalSnapshotStore.java +++ b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/persistence/LocalSnapshotStore.java @@ -223,7 +223,13 @@ public class LocalSnapshotStore extends SnapshotStore { LOG.debug("Deleting files: {}", files); - files.forEach(File::delete); + files.forEach(file -> { + try { + Files.delete(file.toPath()); + } catch (IOException | SecurityException e) { + LOG.error("Unable to delete snapshot file: {}, persistenceId: {} ", file, persistenceId); + } + }); return null; } @@ -232,7 +238,13 @@ public class LocalSnapshotStore extends SnapshotStore { LOG.debug("Deleting files: {}", files); - files.forEach(File::delete); + files.forEach(file -> { + try { + Files.delete(file.toPath()); + } catch (IOException | SecurityException e) { + LOG.error("Unable to delete snapshot file: {}", file); + } + }); return null; }