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
}
}