Project: springxd
Issue XD-3188: FileDeletionListener resolves resources once
In the {{filejdbc}} job, there is the option to delete the imported files. This functionality is created using a listener called the {{FileDeletionStepExecutionListener}}. When you run the job the first time with the {{--deleteFiles=true}}, everything works as expected. The second time you run the job, the files are not deleted. I believe the issue here is that since the {{FileDeletionStepExecutionListener}} is a singleton, the resources are resolved only once (the first time the job runs) and so it works the first time, but if the job is run again later and new files match the expression, they are not picked up. I believe the fix is to make the {{FileDeletionStepExecutionListener}} used in this job step scoped.
Story points: 1