BulkImportResult doImport(final JobStatusListener statusListener,final File[] filesToImport,final String csvImportDescriptorName,final CsvImportDescriptor csvImportDescriptor,final Set<String> importedFiles) throws Exception {
  for (  File fileToImport : filesToImport) {
    importedFiles.add(fileToImport.getAbsolutePath());
  }
  for (  File fileToImport : filesToImport) {
    final BulkImportResult status=doImport(statusListener,fileToImport,csvImportDescriptorName,csvImportDescriptor);
    if (status != BulkImportResult.OK) {
      return status;
    }
  }
  return BulkImportResult.OK;
}

BulkImportResult doImport ( final JobStatusListener statusListener , final File [ ] filesToImport , final String csvImportDescriptorName , final CsvImportDescriptor csvImportDescriptor , final Set < String > importedFiles ) throws Exception { for ( File fileToImport : filesToImport ) { importedFiles . add ( fileToImport . getAbsolutePath ( ) ) ; } for ( File fileToImport : filesToImport ) { final BulkImportResult status = doImport ( statusListener , fileToImport , csvImportDescriptorName , csvImportDescriptor ) ; if ( status != BulkImportResult . OK ) { return status ; } } return BulkImportResult . OK ; }
perform import for each file .
