org.apache.axis2.attachments
Class MIMEHelper

java.lang.Object
  extended byorg.apache.axis2.attachments.MIMEHelper

public class MIMEHelper
extends java.lang.Object


Field Summary
protected  Log log
           
 
Constructor Summary
MIMEHelper(java.io.InputStream inStream, java.lang.String contentTypeString)
           
MIMEHelper(java.io.InputStream inStream, java.lang.String contentTypeString, boolean fileCacheEnable, java.lang.String attachmentRepoDir, java.lang.String fileThreshold)
           
 
Method Summary
 java.lang.String getAttachmentSpecType()
           
 DataHandler getDataHandler(java.lang.String blobContentID)
           
 Part getPart(java.lang.String blobContentID)
           
 java.lang.String getSOAPPartContentType()
           
 java.io.InputStream getSOAPPartInputStream()
           
protected  void setEndOfStream(boolean value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected Log log
Constructor Detail

MIMEHelper

public MIMEHelper(java.io.InputStream inStream,
                  java.lang.String contentTypeString,
                  boolean fileCacheEnable,
                  java.lang.String attachmentRepoDir,
                  java.lang.String fileThreshold)
           throws OMException
Parameters:
inStream -
contentTypeString -
fileCacheEnable -
attachmentRepoDir -
Throws:
OMException - Will move the pointer to the begining of the first MIME part. Will read till first MIME boundary is found or end of stream reached.

MIMEHelper

public MIMEHelper(java.io.InputStream inStream,
                  java.lang.String contentTypeString)
           throws OMException
Parameters:
inStream -
contentTypeString -
Throws:
OMException - Will set file cache to false
Method Detail

getAttachmentSpecType

public java.lang.String getAttachmentSpecType()
Returns:
whether Message Type is SOAP with Attachments or MTOM optimised by checking the application type parameter in the Contant Type

getSOAPPartInputStream

public java.io.InputStream getSOAPPartInputStream()
                                           throws OMException
Returns:
the InputStream which includes the SOAP Envelope We assumes that the root mime part is always pointed by "start" parameter in content-type
Throws:
OMException

getSOAPPartContentType

public java.lang.String getSOAPPartContentType()

getDataHandler

public DataHandler getDataHandler(java.lang.String blobContentID)
                           throws OMException
Parameters:
blobContentID - (without the surrounding angle brackets and "cid:" prefix)
Returns:
The DataHandler of the mime part refered by the content-Id
Throws:
OMException

getPart

public Part getPart(java.lang.String blobContentID)
Parameters:
blobContentID -
Returns:
The Part refered by the content-Id
Throws:
OMException - First checks whether the MIME part is already parsed by checking the parts HashMap. If it is not parsed yet then call the getNextPart() till we find the required part.

setEndOfStream

protected void setEndOfStream(boolean value)