code: public ImportService getImportService(File file, RepositoryCollection source) {
      final Map<String, ImportService> importServicesMappedToExtensions = Maps.newHashMap();
      importServices
          .stream()
          .filter(importService -> importService.canImport(file, source))
          .forEach(
              importService -> {
                for (String extension : importService.getSupportedFileExtensions()) {
                  importServicesMappedToExtensions.put(extension.toLowerCase(), importService);
                }
              });
  
      String extension =
          FileExtensionUtils.findExtensionFromPossibilities(
              file.getName(), importServicesMappedToExtensions.keySet());
  
      final ImportService importService = importServicesMappedToExtensions.get(extension);
  
      if (importService == null)
        throw new MolgenisDataException("Can not import file. No suitable importer found");
  
      return importService;
    }
docs: Finds a suitable ImportService for a FileRepositoryCollection.
  
  <p>Import of mixed backend types in one FileRepositoryCollection isn't supported.
  
  @return ImportService
  @throws MolgenisDataException if no suitable ImportService is found for the
  FileRepositoryCollection