Hello:
Wondering if anyone can help us with this. We are using spring bat to iterate through all xml files in a directory. Unfortunately, we seem to be able to only get the first filename, and this is causing our logs to display the incorrect filename when there are multiple files to process.
Here is the section causing us issues:
If anyone could help us understand what we are doing wrong, it would be greatly appreciated.Code:public void beforeStep(StepExecution stepExecution) { if(LOG.isInfoEnabled()){ LOG.info("Processor beforestep "); } ExecutionContext ecStep = stepExecution.getExecutionContext(); if(!ecStep.isEmpty() && ecStep.containsKey("FOO_FILE")){ try{ setAmrFileName(ecStep.getString("FOO_FILE")); //this is the line we try to set the filename }catch(ClassCastException exception){ // however we only ever get the first one when multiple if(LOG.isDebugEnabled()){ // files exist LOG.debug(exception); } } } }


Reply With Quote