@Override public void aggregate(final Configuration configuration, final List<LaunchResults> launchesResults, final Path outputDirectory) throws IOException { final Path dataFolder = Files.createDirectories(outputDirectory.resolve(Constants.DATA_DIR)); final Path csv = dataFolder.resolve(fileName); try (Writer writer = Files.newBufferedWriter(csv)) { final StatefulBeanToCsvBuilder<T> builder = new StatefulBeanToCsvBuilder<>(writer); final CustomMappingStrategy<T> mappingStrategy = new CustomMappingStrategy<>(); mappingStrategy.setType(type); final StatefulBeanToCsv<T> beanWriter = builder.withMappingStrategy(mappingStrategy).build(); try { beanWriter.write(getData(launchesResults)); } catch (Exception e) { throw new IOException(e); } } }
@Override public void aggregate(final Configuration configuration, final List<LaunchResults> launchesResults, final Path outputDirectory) throws IOException { final Path dataFolder = Files.createDirectories(outputDirectory.resolve(Constants.DATA_DIR)); final Path csv = dataFolder.resolve(fileName); try (Writer writer = Files.newBufferedWriter(csv)) { final StatefulBeanToCsvBuilder<T> builder = new StatefulBeanToCsvBuilder<>(writer); final CustomMappingStrategy<T> mappingStrategy = new CustomMappingStrategy<>(); mappingStrategy.setType(type); final StatefulBeanToCsv<T> beanWriter = builder.withMappingStrategy(mappingStrategy).build(); try { beanWriter.write(getData(launchesResults)); } catch (Exception e) { throw new IOException(e); } } }