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
I am trying to extract Parsing and Msg convertion ability from this code. My requirement is build a REST api interface to convert .msg file in to .eml file.
I am more or less able to convert .msg file to Message object using MsgParser like below
MsgParser parser = new MsgParser();
Message msg = parser.parseMsg(new File("C:\Users\xyz\workspace\projects\demo\xyz.msg"));
However i am facing challenged in converting Message object to eml file using MsgWriter
MsgWriter writer = new MsgWriter();
writer.write(msg, new FileOutputStream("C:\Users\xyz\workspace\projects\demo\xyz.eml"));
These are the contents of my MsgContainer.write() method
public void write(Message msg, OutputStream out) throws IOException {
NPOIFSFileSystem fs = new NPOIFSFileSystem();
DirectoryNode root = fs.getRoot();
MsgContainer cont = new MsgContainer(msg);
cont.write(root);
fs.writeFilesystem(out);
fs.close();
}
Exception i see is
2020-03-03 10:52:37.069 INFO 18036 --- [nio-8080-exec-1] com.example.msgparser.MsgContainer : Msgontainer -> write null
2020-03-03 10:52:37.071 INFO 18036 --- [nio-8080-exec-1] c.example.msgparser.entries.SubstGEntry : SubstGEntry -> 55 - 31
2020-03-03 10:52:37.071 INFO 18036 --- [nio-8080-exec-1] c.example.msgparser.entries.SubstGEntry : __substg1.0_0037001F
2020-03-03 10:52:37.084 ERROR 18036 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.IllegalStateException: Can't read from a new stream before it has been written to] with root cause
java.lang.IllegalStateException: Can't read from a new stream before it has been written to
Please let me know if this is making sense or if you need more information.
Any help is much appreciated.
The text was updated successfully, but these errors were encountered:
Hi,
I am trying to extract Parsing and Msg convertion ability from this code. My requirement is build a REST api interface to convert .msg file in to .eml file.
I am more or less able to convert .msg file to Message object using MsgParser like below
MsgParser parser = new MsgParser();
Message msg = parser.parseMsg(new File("C:\Users\xyz\workspace\projects\demo\xyz.msg"));
However i am facing challenged in converting Message object to eml file using MsgWriter
MsgWriter writer = new MsgWriter();
writer.write(msg, new FileOutputStream("C:\Users\xyz\workspace\projects\demo\xyz.eml"));
These are the contents of my MsgContainer.write() method
public void write(Message msg, OutputStream out) throws IOException {
NPOIFSFileSystem fs = new NPOIFSFileSystem();
DirectoryNode root = fs.getRoot();
MsgContainer cont = new MsgContainer(msg);
cont.write(root);
fs.writeFilesystem(out);
fs.close();
}
Exception i see is
2020-03-03 10:52:37.069 INFO 18036 --- [nio-8080-exec-1] com.example.msgparser.MsgContainer : Msgontainer -> write null
2020-03-03 10:52:37.071 INFO 18036 --- [nio-8080-exec-1] c.example.msgparser.entries.SubstGEntry : SubstGEntry -> 55 - 31
2020-03-03 10:52:37.071 INFO 18036 --- [nio-8080-exec-1] c.example.msgparser.entries.SubstGEntry : __substg1.0_0037001F
2020-03-03 10:52:37.084 ERROR 18036 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.IllegalStateException: Can't read from a new stream before it has been written to] with root cause
java.lang.IllegalStateException: Can't read from a new stream before it has been written to
Please let me know if this is making sense or if you need more information.
Any help is much appreciated.
The text was updated successfully, but these errors were encountered: