From a535790c681a317ad72714649e036b68a705e12c Mon Sep 17 00:00:00 2001 From: Mateusz Warowny Date: Thu, 30 Sep 2021 17:08:32 +0200 Subject: [PATCH] JAL-3878 Add job log messages reporting. --- src/jalview/ws2/slivka/SlivkaWebService.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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 -- 1.7.10.2