Skip to content

Commit 7a05180

Browse files
committed
added logging
1 parent 066f297 commit 7a05180

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/main/java/org/dspace/ctask/replicate/store/LocalObjectStore.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,18 @@ public long transferObject(String group, File file) throws IOException {
103103

104104
File archDir = new File(storeDir, group);
105105
if (!archDir.isDirectory()) {
106-
archDir.mkdirs();
106+
boolean successful = archDir.mkdirs();
107+
if (!successful) {
108+
log.warn("Cannot create directory: '{}'.", archDir);
109+
}
107110
}
108111

109112
File archFile = new File(archDir, file.getName());
110113
if (archFile.exists()) {
111-
archFile.delete();
114+
boolean successful = archFile.delete();
115+
if (!successful) {
116+
log.warn("Cannot delete archive file: '{}'.", archFile);
117+
}
112118
}
113119

114120
if (!file.renameTo(archFile)) {

0 commit comments

Comments
 (0)