【发布时间】:2017-03-17 17:27:56
【问题描述】:
我需要确定附件是否是发件人的签名图像并忽略它,因为我想跳过此类附件,但我无法确定该特定附件是否是签名图像。
或者用户可以在添加签名图像的同时添加自定义属性,以便我可以在程序中查找该属性?
if (emailMessage.getHasAttachments() || emailMessage.getAttachments().getItems().size() > 0) {
//get all the attachments
AttachmentCollection attachmentsCol = emailMessage.getAttachments();
log.info("File Count: " + attachmentsCol.getCount());
Attachment attachment = attachmentsCol.getPropertyAtIndex(i);
//log.debug("Starting to process attachment "+ attachment.getName());
//do we need to skip this attachment
FileAttachment fileAttachment = (FileAttachment) attachment;
// if we don't call this, the Content property may be null.
fileAttachment.load();
booelan isSignatureImage = fileAttachment.isContactPhoto(); // this is false
}
}
【问题讨论】:
标签: java outlook exchangewebservices ewsjavaapi