本文整理了Java中org.apache.camel.Message.getAttachmentObjects()
方法的一些代码示例,展示了Message.getAttachmentObjects()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.getAttachmentObjects()
方法的具体详情如下:
包路径:org.apache.camel.Message
类名称:Message
方法名:getAttachmentObjects
暂无
代码示例来源:origin: org.apache.camel/camel-mail
private Message splitAttachment(Message inMessage, String attachmentName, Attachment attachmentHandler) {
final Message copy = inMessage.copy();
Map<String, Attachment> attachments = copy.getAttachmentObjects();
attachments.clear();
attachments.put(attachmentName, attachmentHandler);
copy.setHeader(HEADER_NAME, attachmentName);
return copy;
}
代码示例来源:origin: org.apache.camel/camel-mail
@Override
public Object evaluate(Exchange exchange) {
// must use getAttachments to ensure attachments is initial populated
if (exchange.getIn().getAttachments().isEmpty()) {
return null;
}
try {
List<Message> answer = new ArrayList<>();
Message inMessage = exchange.getIn();
for (Map.Entry<String, Attachment> entry : inMessage.getAttachmentObjects().entrySet()) {
Message attachmentMessage;
if (extractAttachments) {
attachmentMessage = extractAttachment(inMessage, entry.getKey());
} else {
attachmentMessage = splitAttachment(inMessage, entry.getKey(), entry.getValue());
}
if (attachmentMessage != null) {
answer.add(attachmentMessage);
}
}
return answer;
} catch (Exception e) {
throw new RuntimeCamelException("Unable to split attachments from MimeMultipart message", e);
}
}
代码示例来源:origin: org.apache.camel/camel-cxf
for (Map.Entry<String, org.apache.camel.Attachment> entry : camelExchange.getIn().getAttachmentObjects().entrySet()) {
if (attachments == null) {
attachments = new HashSet<>();
代码示例来源:origin: org.apache.camel/camel-mail
LOG.trace("Adding attachments +++ start +++");
int i = 0;
for (Map.Entry<String, Attachment> entry : exchange.getIn().getAttachmentObjects().entrySet()) {
String attachmentFilename = entry.getKey();
Attachment attachment = entry.getValue();
代码示例来源:origin: org.apache.camel/camel-mail
writeBodyPart(bodyContent, part, contentType);
mp.addBodyPart(part);
for (Map.Entry<String, Attachment> entry : exchange.getIn().getAttachmentObjects().entrySet()) {
String attachmentFilename = entry.getKey();
Attachment attachment = entry.getValue();
代码示例来源:origin: org.apache.camel/camel-jms
getAttachmentObjects().putAll(that.getAttachmentObjects());
代码示例来源:origin: org.apache.camel/camel-cxf
for (Map.Entry<String, org.apache.camel.Attachment> entry : camelExchange.getOut().getAttachmentObjects().entrySet()) {
if (attachments == null) {
attachments = new HashSet<>();
内容来源于网络,如有侵权,请联系作者删除!