class ExportService {

    public Mono<Task.Result> export(Progress progress, Username username) {
        return Mono.usingWhen(
            Mono.fromCallable(() -> zipMailboxesContent(progress, username)),
            inputStream -> export(progress, username, inputStream),
            this::closeResource,
            (inputStream, throwable) -> closeResource(inputStream),
            this::closeResource
        );
    }

    @Inject  ExportService(MailboxBackup mailboxBackup, BlobStore blobStore, BlobExportMechanism blobExport, UsersRepository usersRepository);

}