ASF Bugzilla – Attachment 32963 Details for
Bug 58214
Error with outlook while opening an msg files extracted by POI from another msg file
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
My simple java code
ExtractMsg.java (text/plain), 1.12 KB, created by
Alexandre
on 2015-08-05 12:58:58 UTC
(
hide
)
Description:
My simple java code
Filename:
MIME Type:
Creator:
Alexandre
Created:
2015-08-05 12:58:58 UTC
Size:
1.12 KB
patch
obsolete
>import java.io.FileInputStream; >import java.io.FileOutputStream; > >import org.apache.poi.hsmf.MAPIMessage; >import org.apache.poi.hsmf.datatypes.AttachmentChunks; >import org.apache.poi.poifs.filesystem.EntryUtils; >import org.apache.poi.poifs.filesystem.POIFSFileSystem; > > >public class ExtractMsg { > > static String MAIL = "c:/Temp/Master mail.msg"; > static String EXTRACTED_MAIL = "c:/Temp/Test mail attachment_from POI.msg"; > > > public static void main(String[] args) throws Exception { > > new ExtractMsg().parser(); > > } > > public void parser() throws Exception > { > > MAPIMessage msg = new MAPIMessage(new POIFSFileSystem(new FileInputStream(MAIL))); > if (msg.getAttachmentFiles() != null && msg.getAttachmentFiles().length == 1) { > AttachmentChunks att = msg.getAttachmentFiles()[0]; > if (att.attachmentDirectory != null) { > > POIFSFileSystem newMsg = new POIFSFileSystem(); > EntryUtils.copyNodes(att.attachmentDirectory.getDirectory(), newMsg.getRoot()); > > FileOutputStream out = new FileOutputStream(EXTRACTED_MAIL); > newMsg.writeFilesystem(out); > out.close(); > } > } > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 58214
:
32960
|
32961
|
32962
| 32963 |
32966
|
32967
|
32968
|
32969