poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 47991] HSMF - All .msg attachments have zeros at the end of the files
Date Fri, 11 Dec 2009 12:00:02 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=47991

--- Comment #2 from yoda@oleco.net 2009-12-11 04:00:00 UTC ---
Created an attachment (id=24690)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24690)
Test files as zip, contains msg and attachments before and after processing

My sample code:

MAPIMessage mapiMsg = new MAPIMessage( new FileInputStream( new
File("plain.msg") ) );
Map<String, ByteArrayInputStream> atts = mapiMsg.getAttachmentFiles();
if( atts != null && atts.size() == 1 )
{
    String attName = atts.keySet().iterator().next();
    ByteArrayInputStream att = atts.get( attName );
    FileUtils.stream( att, new FileOutputStream( new File("after.txt") ) );
}

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message