org.apache.axis2.attachments
Class MIMEHelper
java.lang.Object
org.apache.axis2.attachments.MIMEHelper
- public class MIMEHelper
- extends Object
Field Summary |
protected org.apache.commons.logging.Log |
log
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
protected org.apache.commons.logging.Log log
MIMEHelper
public MIMEHelper(InputStream inStream,
String contentTypeString,
boolean fileCacheEnable,
String attachmentRepoDir,
String fileThreshold)
throws OMException
- Moves the pointer to the beginning of the first MIME part. Reads
till first MIME boundary is found or end of stream is reached.
- Parameters:
inStream
- contentTypeString
- fileCacheEnable
- attachmentRepoDir
-
- Throws:
OMException
MIMEHelper
public MIMEHelper(InputStream inStream,
String contentTypeString)
throws OMException
- Sets file cache to false.
- Parameters:
inStream
- contentTypeString
-
- Throws:
OMException
getAttachmentSpecType
public String getAttachmentSpecType()
- Returns:
- whether Message Type is SOAP with Attachments or MTOM optimized,
by checking the application type parameter in the Content Type.
getSOAPPartInputStream
public InputStream getSOAPPartInputStream()
throws OMException
- Returns:
- the InputStream which includes the SOAP Envelope. It assumes that
the root mime part is always pointed by "start" parameter in
content-type.
- Throws:
OMException
getSOAPPartContentType
public String getSOAPPartContentType()
getDataHandler
public javax.activation.DataHandler getDataHandler(String blobContentID)
throws OMException
- Parameters:
blobContentID
- (without the surrounding angle brackets and "cid:" prefix)
- Returns:
- The DataHandler of the mime part referred by the Content-Id
- Throws:
OMException
getPart
public Part getPart(String blobContentID)
- Checks whether the MIME part is already parsed by checking the
parts HashMap. If it is not parsed yet then call the getNextPart()
till the required part is found.
- Parameters:
blobContentID
-
- Returns:
- The Part referred by the Content-Id
- Throws:
OMException
setEndOfStream
protected void setEndOfStream(boolean value)