in extensions/commons-csv/src/main/java/org/apache/batchee/csv/CommonsCsvWriter.java [141:158]
public void open(final Serializable checkpoint) throws Exception {
final CsvWriterMapper defaultMapper = mapping != null ? new DefaultMapper(Thread.currentThread().getContextClassLoader().loadClass(mapping)) : null;
mapperInstance = mapper == null ?
(defaultMapper != null ? new BeanLocator.LocatorInstance<CsvWriterMapper>(defaultMapper, null) : null) :
BeanLocator.Finder.get(locator).newInstance(CsvWriterMapper.class, mapper);
if ((header == null || header.isEmpty()) && Boolean.parseBoolean(writeHeaders) && DefaultMapper.class.isInstance(mapperInstance.getValue()) && checkpoint == null) {
header = toListString(DefaultMapper.class.cast(mapperInstance.getValue()).getHeaders());
}
final CSVFormat format = newFormat();
final File file = new File(output);
if (!file.getParentFile().exists() && !file.getParentFile().mkdirs()) {
throw new IllegalStateException("Cant create " + file);
}
this.transactionalWriter = new TransactionalWriter(file, encoding, checkpoint);
this.writer = format.print(transactionalWriter);
}