From: Mateusz Warowny Date: Thu, 30 Sep 2021 15:08:32 +0000 (+0200) Subject: JAL-3878 Add job log messages reporting. X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=a535790c681a317ad72714649e036b68a705e12c;p=jalview.git JAL-3878 Add job log messages reporting. --- diff --git a/src/jalview/ws2/slivka/SlivkaWebService.java b/src/jalview/ws2/slivka/SlivkaWebService.java index 3f0f5b0..bd4cb61 100644 --- a/src/jalview/ws2/slivka/SlivkaWebService.java +++ b/src/jalview/ws2/slivka/SlivkaWebService.java @@ -1,6 +1,7 @@ package jalview.ws2.slivka; import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; @@ -189,6 +190,22 @@ public class SlivkaWebService implements WebServiceI { var slivkaJob = client.getJob(job.getJobId()); job.setStatus(statusMap.get(slivkaJob.getStatus())); + Collection files = slivkaJob.getResults(); + for (RemoteFile f : files) + { + if (f.getLabel().equals("log")) + { + ByteArrayOutputStream stream = new ByteArrayOutputStream(); + f.writeTo(stream); + job.setLog(stream.toString("UTF-8")); + } + else if (f.getLabel().equals("error-log")) + { + ByteArrayOutputStream stream = new ByteArrayOutputStream(); + f.writeTo(stream); + job.setErrorLog(stream.toString("UTF-8")); + } + } } @Override