class CSVArtifactMapper {

    public Path writeArtifactsToCsvFile(Collection<Artifact> artifacts) {
        try (BufferedWriter writer = Files.newBufferedWriter(csvFile);
             CSVPrinter csvPrinter = new CSVPrinter(writer, CSVFormat.DEFAULT.withHeader(COLUMN_NAMES))
        ) {
            for (Artifact artifact : artifacts) {
                csvPrinter.printRecords(makeCsvRecordsFromArtifact(artifact));
            }
            csvPrinter.flush();
            return csvFile.toAbsolutePath();
        } catch (IOException e) {
            LOGGER.error("Error when writing the csv file", e);
            return null;
        }
    }

    public  CSVArtifactMapper(Path csvFile, Charset encoding, char delimiter, Path baseDir);

}