Skip to content

Commit c6f5029

Browse files
committed
Clarify the behaviour of MultiResourceItemWriter with regard to file creation
Resolves #4645
1 parent 050fce5 commit c6f5029

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/MultiResourceItemWriter.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2006-2023 the original author or authors.
2+
* Copyright 2006-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -36,7 +36,11 @@
3636
* <p>
3737
* Note that new resources are created only at chunk boundaries i.e. the number of items
3838
* written into one resource is between the limit set by
39-
* {@link #setItemCountLimitPerResource(int)} and (limit + chunk size).
39+
* <p>
40+
* This writer will create an output file only when there are items to write, which means
41+
* there would be no empty file created if no items are passed (for example when all items
42+
* are filtered or skipped during the processing phase).
43+
* </p>
4044
*
4145
* @param <T> item type
4246
* @author Robert Kasanicky

0 commit comments

Comments
 (0)