use of org.opendatakit.briefcase.reused.job.JobsRunner in project briefcase by opendatakit.
the class Central method push.
@Override
public JobsRunner push(TransferForms forms, Path briefcaseDir) {
forms.filter(FormStatus::isEncrypted).forEach(form -> form.setStatusString("Skipping. Encrypted forms can't be pushed to ODK Central yet"));
String token = http.execute(server.getSessionTokenRequest()).orElseThrow(() -> new BriefcaseException("Can't authenticate with ODK Central"));
PushToCentral pushOp = new PushToCentral(http, server, briefcaseDir, token, EventBus::publish);
return JobsRunner.launchAsync(forms.filter(f -> !f.isEncrypted()).map(pushOp::push)).onComplete(() -> EventBus.publish(new PushEvent.Complete()));
}
Aggregations