poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Burch <nick.bu...@alfresco.com>
Subject Re: Read .msg file inside other .msg file
Date Tue, 10 Jul 2012 11:15:27 GMT
On 10/07/12 11:54, lucaro wrote:
> In two ways I tried, but Problem still persist.

What problem?

> POIFSFileSystem newDoc = new POIFSFileSystem();
> EntryUtils.copyNodes(attachment.attachmentDirectory.getDirectory(),
> newDoc.getRoot());
> File fileToWrite = new File("C:/CR0040POC/detachedMail/" +
> attachMsg.getConversationTopic()+".msg");
> OutputStream outStream = new FileOutputStream(fileToWrite);
> newDoc.writeFilesystem(outStream);
> //In this way it is giving me error in opening file.

What sort of error? This looks like it ought to work

> POIFSFileSystem newDoc =
> attachment.attachmentDirectory.getDirectory().getFileSystem();
> File fileToWrite = new File("C:/CR0040POC/detachedMail/" +
> attachMsg.getConversationTopic()+".msg");
> OutputStream outStream = new FileOutputStream(fileToWrite);
> newDoc.writeFilesystem(outStream);

This won't work. You need to do a copy. This just writes the same thing 
out again

Nick

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


Mime
View raw message