Skip to content

Commit

Permalink
#2638 fixing the javax warning while adding attachments
Browse files Browse the repository at this point in the history
  • Loading branch information
shroffk committed Jul 28, 2020
1 parent 54ddae4 commit 0fa0404
Showing 1 changed file with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Attachment>() {
@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
Expand Down

0 comments on commit 0fa0404

Please sign in to comment.