Announcement Announcement Module
No announcement yet.
FlatFileItemReader and how to skip empty files Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • FlatFileItemReader and how to skip empty files

    How do I configure the FlatFileItemReader to skip empty files and if possible create a log entry about the emtpy file?

  • #2
    By default, the FileItemReader will return null signaling that the step is complete when it encounters an empty file (assuming that the file exists. If it doesn't, we're talking about a different scenario). In this case you could create a StepListener that checks the number of records read in. If it is zero, you can then perform whatever logic you want there.

    Let me know if you need more details.