Is it OK to add a few lines of code in AttachmentChunks.record() method: // added an "else if" block to get CONTENT-ID field. else if(chunkId == MAPIProperty.ATTACH_CONTENT_ID.id) { attachContentId = (StringChunk) chunk; } Thanks.
Sounds like a good idea! Do you have a document (or does one our existing test documents [1]) have an attach content id that we could use for a unit test? Are you willing to modify an existing unit test or write up a new unit test so we can verify the fix? See [2] or [3] for existing unit tests. Also, what data type is attachContentId? [1] HSMF test documents: https://svn.apache.org/viewvc/poi/trunk/test-data/hsmf/ [2] HSMF unit tests http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hsmf/datatypes/ and http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hsmf/
Created attachment 34585 [details] MSG messages with inline image attachments. This attachments includes four inline images(attachments) with Content-ID field.
Hi Javen, Thanks for the quick response. 1. I already attached a file which has four inline attachments. 2. Sure, I would like to take a look at the existing unit tests and add a few more accordingly. Thanks again
(In reply to Javen O'Neal from comment #1) > Sounds like a good idea! > > Do you have a document (or does one our existing test documents [1]) have an > attach content id that we could use for a unit test? > > Are you willing to modify an existing unit test or write up a new unit test > so we can verify the fix? See [2] or [3] for existing unit tests. > > Also, what data type is attachContentId? > > [1] HSMF test documents: > https://svn.apache.org/viewvc/poi/trunk/test-data/hsmf/ > [2] HSMF unit tests > http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/ > poi/hsmf/datatypes/ and > http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/ > poi/hsmf/ Hi Javen, Thanks for the response. I think the data type of attachContentId should be: public StringChunk attachContentId; I already added a test case in TestFileWithAttachmentsRead.java (testReadContentIDField()) and uploaded the java file and associated test file(attachment_msg_inlineImg.msg) for you to review. Thanks for the help.
Created attachment 34586 [details] Java file with newly added test case Added a new field: private MAPIMessage inlineImgMsgAttachments; it is initialized as : this.inlineImgMsgAttachments = new MAPIMessage(samples.openResourceAsStream("attachment_msg_inlineImg.msg")); Added a new test case: public void testReadContentIDField()
Created attachment 34587 [details] test file for newly added test case testReadContentIDField() A MSG file with 4 inline image attachments. Each of them has a Content-ID field.
Thanks for the patch, unit test, and email message file. Feel free to check out our contributor guidelines [1], which has some examples of creating patches [2]. (a simple svn diff works too). This will be available in 3.16 beta 2. Applied to trunk in r1777428 and r1777429. [1] https://poi.apache.org/guidelines.html#SubmittingPatches [2] https://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hsmf/TestFileWithAttachmentsRead.java?r1=1777428&r2=1777427&pathrev=1777428&view=patch