From 0fa04047af14197490312d02098469a7cae28934 Mon Sep 17 00:00:00 2001 From: Kunal Shroff Date: Tue, 28 Jul 2020 16:24:56 -0400 Subject: [PATCH] #2638 fixing the javax warning while adding attachments --- .../edu/msu/nscl/olog/api/OlogClientImpl.java | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/thirdparty/plugins/edu.msu.nscl.olog.api/src/edu/msu/nscl/olog/api/OlogClientImpl.java b/thirdparty/plugins/edu.msu.nscl.olog.api/src/edu/msu/nscl/olog/api/OlogClientImpl.java index 4390f4b5aa7..34fc6735b7b 100644 --- a/thirdparty/plugins/edu.msu.nscl.olog.api/src/edu/msu/nscl/olog/api/OlogClientImpl.java +++ b/thirdparty/plugins/edu.msu.nscl.olog.api/src/edu/msu/nscl/olog/api/OlogClientImpl.java @@ -823,14 +823,19 @@ public Log call() throws Exception { @Override public Attachment add(File local, Long logId) throws OlogException { - FormDataMultiPart form = new FormDataMultiPart(); - form.bodyPart(new FileDataBodyPart("file", local)); - XmlAttachment xmlAttachment = service.path("attachments") - .path(logId.toString()).type(MediaType.MULTIPART_FORM_DATA) - .accept(MediaType.APPLICATION_XML) - .post(XmlAttachment.class, form); - - return new Attachment(xmlAttachment); + return wrappedSubmit(new Callable() { + @Override + public Attachment call() throws Exception { + FormDataMultiPart form = new FormDataMultiPart(); + form.bodyPart(new FileDataBodyPart("file", local)); + XmlAttachment xmlAttachment = service.path("attachments") + .path(logId.toString()).type(MediaType.MULTIPART_FORM_DATA) + .accept(MediaType.APPLICATION_XML) + .post(XmlAttachment.class, form); + + return new Attachment(xmlAttachment); + } + }); } @Override