BeanMappingXMLBuilder implements BeanMappingsBuilder { public void loadFiles(List<String> files) { for (String path : files) { URL url = MappingValidator.validateURL(path, beanContainer); LOG.info("Using URL [" + path + "] to load custom xml mappings"); try (InputStream stream = new BufferedInputStream(url.openStream())) { load(stream); } catch (IOException ex) { MappingUtils.throwMappingException(ex); } } } BeanMappingXMLBuilder(BeanContainer beanContainer, ELEngine elEngine); void loadFiles(List<String> files); void loadInputStreams(List<Supplier<InputStream>> xmlMappingSuppliers); @Override List<MappingFileData> build(BeanContainer beanContainer, DestBeanCreator destBeanCreator, PropertyDescriptorFactory propertyDescriptorFactory);  }
@Test public void canLoadFiles() throws IOException { File folder = new File(new File(".").getCanonicalPath() + "/src/test/resources/mappings"); Stream<File> listOfFiles = Arrays.stream(folder.listFiles()); BeanMappingXMLBuilder builder = new BeanMappingXMLBuilder(new BeanContainer(), new NoopELEngine()); builder.loadFiles(listOfFiles.map(file -> "file:" + file.getAbsolutePath()).collect(Collectors.toList())); }