org.apache.axiom.attachments
Class Attachments

java.lang.Object
  extended byorg.apache.axiom.attachments.Attachments

public class Attachments
extends java.lang.Object


Field Summary
protected  org.apache.commons.logging.Log log
           
 
Constructor Summary
Attachments(java.io.InputStream inStream, java.lang.String contentTypeString)
          Sets file cache to false.
Attachments(java.io.InputStream inStream, java.lang.String contentTypeString, boolean fileCacheEnable, java.lang.String attachmentRepoDir, java.lang.String fileThreshold)
          Moves the pointer to the beginning of the first MIME part.
 
Method Summary
 java.lang.String[] getAllContentIDs()
           
 java.lang.String getAttachmentSpecType()
           
 javax.activation.DataHandler getDataHandler(java.lang.String blobContentID)
           
 IncomingAttachmentStreams getIncomingAttachmentStreams()
          Stream based access
 Part getPart(java.lang.String blobContentID)
          Checks whether the MIME part is already parsed by checking the parts HashMap.
 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 org.apache.commons.logging.Log log
Constructor Detail

Attachments

public Attachments(java.io.InputStream inStream,
                   java.lang.String contentTypeString,
                   boolean fileCacheEnable,
                   java.lang.String attachmentRepoDir,
                   java.lang.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

Attachments

public Attachments(java.io.InputStream inStream,
                   java.lang.String contentTypeString)
            throws OMException
Sets file cache to false.

Parameters:
inStream -
contentTypeString -
Throws:
OMException
Method Detail

getAttachmentSpecType

public java.lang.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 java.io.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 java.lang.String getSOAPPartContentType()

getDataHandler

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

getIncomingAttachmentStreams

public IncomingAttachmentStreams getIncomingAttachmentStreams()
                                                       throws java.lang.IllegalStateException
Stream based access

Returns:
The stream container of type IncomingAttachmentStreams
Throws:
java.lang.IllegalStateException - if application has alreadt started using Part's directly

getPart

public Part getPart(java.lang.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

getAllContentIDs

public java.lang.String[] getAllContentIDs()

setEndOfStream

protected void setEndOfStream(boolean value)