Source:
<code>public static void export(BriefcaseFormDefinition formDefinition, ExportConfiguration configuration, TerminationFuture terminationFuture) { if (formDefinition.isFileEncryptedForm() || formDefinition.isFieldEncryptedForm()) { formDefinition.setPrivateKey(readPemFile(configuration.getPemFile() .orElseThrow(() -> new RuntimeException("PEM file not present")) ).get()); } boolean overwriteExistingFiles = configuration.getOverwriteExistingFiles().isPresent() ? configuration.getOverwriteExistingFiles().get() : false; ExportToCsv action = new ExportToCsv( terminationFuture, configuration.getExportDir().orElseThrow(() -> new RuntimeException("Export dir not present")).toFile(), formDefinition, formDefinition.getFormName(), true, <START> overwriteExistingFiles, <END> configuration.mapStartDate((LocalDate ld) -> Date.from(ld.atStartOfDay(ZoneId.systemDefault()).toInstant())).orElse(null), configuration.mapEndDate((LocalDate ld) -> Date.from(ld.atStartOfDay(ZoneId.systemDefault()).toInstant())).orElse(null) ); try { boolean allSuccessful = action.doAction(); if (!allSuccessful) EventBus.publish(new ExportFailedEvent(action.getFormDefinition())); if (allSuccessful && action.noneSkipped()) EventBus.publish(new ExportSucceededEvent(action.getFormDefinition())); if (allSuccessful && action.someSkipped()) EventBus.publish(new ExportSucceededWithErrorsEvent(action.getFormDefinition())); if (allSuccessful && action.allSkipped()) EventBus.publish(new ExportFailedEvent(action.getFormDefinition())); } catch (Exception e) { log.error("export action failed", e); EventBus.publish(new ExportFailedEvent(action.getFormDefinition())); } }</code><technical_language>This line configuration.getOverwriteExistingFiles().orElse(false), Remember if handling Optional<T> if, probable right</technical_language>

Target:
public static void export(BriefcaseFormDefinition formDefinition, ExportConfiguration configuration, TerminationFuture terminationFuture) { if (formDefinition.isFileEncryptedForm() || formDefinition.isFieldEncryptedForm()) { formDefinition.setPrivateKey(readPemFile(configuration.getPemFile() .orElseThrow(() -> new RuntimeException("PEM file not present")) ).get()); } ExportToCsv action = new ExportToCsv( terminationFuture, configuration.getExportDir().orElseThrow(() -> new RuntimeException("Export dir not present")).toFile(), formDefinition, formDefinition.getFormName(), true, configuration.getOverwriteExistingFiles().orElse(false), configuration.mapStartDate((LocalDate ld) -> Date.from(ld.atStartOfDay(ZoneId.systemDefault()).toInstant())).orElse(null), configuration.mapEndDate((LocalDate ld) -> Date.from(ld.atStartOfDay(ZoneId.systemDefault()).toInstant())).orElse(null) ); try { boolean allSuccessful = action.doAction(); if (!allSuccessful) EventBus.publish(new ExportFailedEvent(action.getFormDefinition())); if (allSuccessful && action.noneSkipped()) EventBus.publish(new ExportSucceededEvent(action.getFormDefinition())); if (allSuccessful && action.someSkipped()) EventBus.publish(new ExportSucceededWithErrorsEvent(action.getFormDefinition())); if (allSuccessful && action.allSkipped()) EventBus.publish(new ExportFailedEvent(action.getFormDefinition())); } catch (Exception e) { log.error("export action failed", e); EventBus.publish(new ExportFailedEvent(action.getFormDefinition())); } }