diff --git a/src/main/java/com/coreoz/windmill/exports/exporters/csv/CsvExporter.java b/src/main/java/com/coreoz/windmill/exports/exporters/csv/CsvExporter.java index aff964b..f34c219 100644 --- a/src/main/java/com/coreoz/windmill/exports/exporters/csv/CsvExporter.java +++ b/src/main/java/com/coreoz/windmill/exports/exporters/csv/CsvExporter.java @@ -71,7 +71,7 @@ private void writeHeaderRow() { for (int i = 0; i < headerColumn.size(); i++) { csvRowValues[i] = stringValue(headerColumn.get(i)); } - csvWriter.writeNext(csvRowValues); + csvWriter.writeNext(csvRowValues,exportConfig.isApplyQuotesToAll()); } } @@ -81,7 +81,7 @@ private void writeRow(T row) { for (int i = 0; i < mapping.columnsCount(); i++) { csvRowValues[i] = stringValue(mapping.cellValue(i, row)); } - csvWriter.writeNext(csvRowValues); + csvWriter.writeNext(csvRowValues, exportConfig.isApplyQuotesToAll()); csvWriter.flush(); } diff --git a/src/main/java/com/coreoz/windmill/exports/exporters/csv/ExportCsvConfig.java b/src/main/java/com/coreoz/windmill/exports/exporters/csv/ExportCsvConfig.java index ff78361..940efac 100644 --- a/src/main/java/com/coreoz/windmill/exports/exporters/csv/ExportCsvConfig.java +++ b/src/main/java/com/coreoz/windmill/exports/exporters/csv/ExportCsvConfig.java @@ -23,5 +23,8 @@ public class ExportCsvConfig { @Builder.Default private final char escapeChar = ICSVParser.DEFAULT_ESCAPE_CHARACTER; /** The line feed terminator to use */ @Builder.Default private final String lineEnd = CSVWriter.DEFAULT_LINE_END; + /** The boolean to use for applying or not optional wrapping quotes */ + @Builder.Default private final boolean applyQuotesToAll = true; + }