Map<String, List<String>> headers
= CastUtils.cast((Map<?, ?>)inMessage.get(AttachmentDeserializer.ATTACHMENT_PART_HEADERS));
Attachment first = new Attachment(AttachmentUtil.createAttachment(
inMessage.getContent(InputStream.class),
headers),
new ProvidersImpl(inMessage));
newAttachments.add(first);
} catch (IOException ex) {
throw new WebApplicationException(500);
}
Collection<org.apache.cxf.message.Attachment> childAttachments = inMessage.getAttachments();
if (childAttachments == null) {
childAttachments = Collections.emptyList();
}
childAttachments.size();
for (org.apache.cxf.message.Attachment a : childAttachments) {
newAttachments.add(new Attachment(a, new ProvidersImpl(inMessage)));
}
MediaType mt = embeddedAttachment
? (MediaType)inMessage.get("org.apache.cxf.multipart.embedded.ctype")
: getHttpHeaders().getMediaType();
MultipartBody body = new MultipartBody(newAttachments, mt, false);