0
我需要识别附件是发件人的签名图像并忽略它,因为我想跳过那种附件,但我无法识别是否该特定的附件是签名图像。Java EWS-如何识别附件是否为发件人签名图像
或者用户可以在添加签名图像的同时添加自定义属性,以便我可以在程序中查找该属性?
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
}
}