Results 1 to 2 of 2

Thread: FlatFileItemReader and how to skip empty files

  1. #1
    Join Date
    Mar 2011
    Posts
    1

    Default 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. #2
    Join Date
    Sep 2008
    Location
    Chicagoland, IL
    Posts
    349

    Default

    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •