Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Use Files.delete() in LocalSnapshotStore
[controller.git]
/
opendaylight
/
md-sal
/
sal-clustering-commons
/
src
/
main
/
java
/
org
/
opendaylight
/
controller
/
cluster
/
persistence
/
LocalSnapshotStore.java
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 76babc15db7d831403e985c658e3a3cef46f3e99..62b0cf5bfd061867da72cd4084eb8eec86d72821 100644
(file)
--- 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);
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;
}
return null;
}
@@
-232,7
+238,13
@@
public class LocalSnapshotStore extends SnapshotStore {
LOG.debug("Deleting files: {}", files);
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;
}
return null;
}