Results 1 to 4 of 4

Thread: Need help getting all filename strings

Threaded View

  1. #1
    Join Date
    Oct 2010
    Posts
    2

    Default Need help getting all filename strings

    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:

    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);
                            }
                      }
                }
          }
    If anyone could help us understand what we are doing wrong, it would be greatly appreciated.
    Last edited by kmspring; Oct 22nd, 2010 at 12:27 PM.

Posting Permissions

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