You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/AbstractFileItemWriter.java
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -270,7 +270,9 @@ public void close() {
270
270
state.close();
271
271
if (state.linesWritten == 0 && shouldDeleteIfEmpty) {
272
272
try {
273
-
resource.getFile().delete();
273
+
if (!resource.getFile().delete()) {
274
+
thrownewItemStreamException("Failed to delete empty file on close");
275
+
}
274
276
}
275
277
catch (IOExceptione) {
276
278
thrownewItemStreamException("Failed to delete empty file on close", e);
0 commit comments