You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When reading nested outlook messages back from the attachment datasource (as attachments on an Email instance are datasources), attachments said outlook message are missing.
The reason for this is that reading nested Outlook messages as attachment of another Outlook msg is only possible by converting it to a Java structure first (using outlook-message-parser). This is a one-way conversion. Since the nested outlook message-as-an-attachment should be represented as attachment under an Email instance, it should be serialized to a datasource. Nested attachments then of this nested Outlook message are datasources themselves and cannot be serialized (javax.activation.DataSource is a JDK interface).
To solve this problem, a more comprehensive serialization solution is needed. Kryo should solve the problem nicely.
The text was updated successfully, but these errors were encountered:
So the OutlookModule now has an extra dependency on Kryo, but nested attachments are now maintained when trying the read back nested outlook messages. I'm including a convenient SerializationUtil to keep your code clean:
public Email getNestedOutlookMessage(...yourOutlookMessageSource) {
Email email = EmailConverter.outlookMsgToEmail(yourOutlookMessageSource);
// now the nested Outlook message is converted to an Email and subsequently serialized:
// email.getAttachments().get(0).getName() == "attachment 0 as nested Outlook message (converted).sjm"
InputStream sjmInputstream = email.getAttachments().get(0).getDataSourceInputStream();
Email nestedOutlookMessage = SerializationUtil.deserialize(sjmInputstream);
return nestedOutlookMessage; // now with attachments, yay!
}
Originally reported under #298:
When reading nested outlook messages back from the attachment datasource (as attachments on an Email instance are datasources), attachments said outlook message are missing.
The reason for this is that reading nested Outlook messages as attachment of another Outlook msg is only possible by converting it to a Java structure first (using outlook-message-parser). This is a one-way conversion. Since the nested outlook message-as-an-attachment should be represented as attachment under an Email instance, it should be serialized to a datasource. Nested attachments then of this nested Outlook message are datasources themselves and cannot be serialized (javax.activation.DataSource is a JDK interface).
To solve this problem, a more comprehensive serialization solution is needed. Kryo should solve the problem nicely.
The text was updated successfully, but these errors were encountered: