Issue: IS MIME Service to extract Body Part content

Trying to extract Excel attachments from mail box and process using IS flow services. Below is the logic using to extract the data and convert into input stream to pass into Excel API which can accept the stream.

#1. Configured one IS SMTP port listener to read mails from IMAP mail server.

#2. Written a custom content handler to process the MIME message with Excel body part. The handler will convert the entire MIME message into a String.

#3. Converting the output Siring into a stream data “using stringToStream” sample service. Stream object is now type of “java.io.StringBufferInputStream”.

#4. Using IS MIME service “createMimeDate” to convert the stream into a MIME Object. Now I can see the MIME object with headers and one Body Part as object “java.io.ByteArrayInputStream”.

#5. Using getBodyPartContent MIME service to convert the MIME data part to a content stream.

#6.Passing the content stream to the Excel API, which is using the code “File f = new File(contentStream)”.

Getting an run time error for #6 as “Input file is not found” and Null pointer exception.

So to debug, added another step after #5, to convert the content stream again to string using “streamToString” sample service. But in pipeline the string is null.

Your help would be great.

jeyaraman

Did you get your content handler to work with excel files ?

I have written the code to read excel by usinh the POI API, but not the content handler.