use of org.rundeck.client.util.ServiceClient in project rundeck-cli by rundeck.
the class Archives method loopStatus.
public static boolean loopStatus(final ServiceClient<RundeckApi> client, final ProjectExportStatus status, String project, File outputfile, CommandOutput out, BooleanSupplier waitFunc) throws IOException {
boolean done = false;
int perc = status.getPercentage();
while (!done) {
ProjectExportStatus status1 = client.apiCall(api -> api.exportProjectStatus(project, status.getToken()));
if (status1.getPercentage() > perc) {
out.output(".");
perc = status1.getPercentage();
}
done = status1.getReady();
if (!done && !waitFunc.getAsBoolean()) {
break;
}
}
if (done) {
receiveArchiveFile(out, client.apiCall(api -> api.exportProjectDownload(project, status.getToken())), outputfile);
}
return done;
}
Aggregations