Closed old741 closed 4 years ago
On spring batch it s writer.setShouldDeleteIfEmpty(true); with FlatFileItemWriter How do it on EasyBatch wiith FileRecordWriter please?
You can't do it with the FileRecordWriter
. It is not the responsibility of the writer to delete or move the file if no records have been written. You can do that using a JobListener#afterJob
instead, something like:
public void afterJob(JobReport jobReport) {
if (jobReport.getMetrics().getWriteCount() == 0) {
delete(yourFile);
}
}
Thank you !
Hello , i use v5.3.0 I use JdbcRecordReader and writer. I want write in my file if only my query return at least one line. How can I do it please ?