public class Attachments extends Object implements OMAttachmentAccessor
| Modifier and Type | Field and Description |
|---|---|
protected static org.apache.commons.logging.Log |
log |
| Constructor and Description |
|---|
Attachments()
Use this constructor when instantiating this to store the attachments set programatically
through the SwA API.
|
Attachments(InputStream inStream,
String contentTypeString)
Sets file cache to false.
|
Attachments(InputStream inStream,
String contentTypeString,
boolean fileCacheEnable,
String attachmentRepoDir,
String fileThreshold)
Moves the pointer to the beginning of the first MIME part.
|
Attachments(InputStream inStream,
String contentTypeString,
boolean fileCacheEnable,
String attachmentRepoDir,
String fileThreshold,
int contentLength)
Moves the pointer to the beginning of the first MIME part.
|
Attachments(LifecycleManager manager,
InputStream inStream,
String contentTypeString,
boolean fileCacheEnable,
String attachmentRepoDir,
String fileThreshold)
Moves the pointer to the beginning of the first MIME part.
|
Attachments(LifecycleManager manager,
InputStream inStream,
String contentTypeString,
boolean fileCacheEnable,
String attachmentRepoDir,
String fileThreshold,
int contentLength)
Moves the pointer to the beginning of the first MIME part.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addDataHandler(String contentID,
DataHandler dataHandler)
Programatically adding an SOAP with Attachments(SwA) Attachment.
|
String[] |
getAllContentIDs()
Get the content IDs of all MIME parts in the message.
|
String |
getAttachmentSpecType()
Identify the type of message (MTOM or SOAP with attachments) represented by this
object.
|
List |
getContentIDList()
Get the content IDs of the already loaded MIME parts in the message.
|
Set |
getContentIDSet()
Get the content IDs of all MIME parts in the message.
|
long |
getContentLength()
If the Attachments is backed by an InputStream, then this
method returns the length of the message contents
(Length of the entire message - Length of the Transport Headers)
|
DataHandler |
getDataHandler(String blobContentID)
Checks whether the MIME part is already parsed by checking the attachments HashMap.
|
Map |
getHeaders()
Get the headers of the already loaded MIME parts in the message.
|
InputStream |
getIncomingAttachmentsAsSingleStream()
Returns the rest of mime stream.
|
IncomingAttachmentStreams |
getIncomingAttachmentStreams()
Stream based access
|
LifecycleManager |
getLifecycleManager() |
Map |
getMap()
Get a map of all MIME parts in the message.
|
String |
getSOAPPartContentID() |
String |
getSOAPPartContentType() |
InputStream |
getSOAPPartInputStream() |
void |
removeDataHandler(String blobContentID)
Removes the DataHandler corresponding to the given contenID.
|
protected void |
setEndOfStream(boolean value)
endOfStreamReached will be set to true if the message ended in MIME Style having "--" suffix
with the last mime boundary
|
void |
setHeaders(Map headers)
Set the headers of the MIME parts in the message.
|
void |
setLifecycleManager(LifecycleManager manager) |
public Attachments(LifecycleManager manager, InputStream inStream, String contentTypeString, boolean fileCacheEnable, String attachmentRepoDir, String fileThreshold) throws OMException
inStream - contentTypeString - fileCacheEnable - attachmentRepoDir - OMExceptionpublic Attachments(LifecycleManager manager, InputStream inStream, String contentTypeString, boolean fileCacheEnable, String attachmentRepoDir, String fileThreshold, int contentLength) throws OMException
inStream - contentTypeString - fileCacheEnable - attachmentRepoDir - fileThreshold - contentLength - OMExceptionpublic Attachments(InputStream inStream, String contentTypeString, boolean fileCacheEnable, String attachmentRepoDir, String fileThreshold) throws OMException
inStream - contentTypeString - fileCacheEnable - attachmentRepoDir - OMExceptionpublic Attachments(InputStream inStream, String contentTypeString, boolean fileCacheEnable, String attachmentRepoDir, String fileThreshold, int contentLength) throws OMException
inStream - contentTypeString - fileCacheEnable - attachmentRepoDir - fileThreshold - contentLength - OMExceptionpublic Attachments(InputStream inStream, String contentTypeString) throws OMException
inStream - contentTypeString - OMExceptionpublic Attachments()
public LifecycleManager getLifecycleManager()
public void setLifecycleManager(LifecycleManager manager)
public String getAttachmentSpecType()
MTOMConstants.MTOM_TYPE, MTOMConstants.SWA_TYPE
or MTOMConstants.SWA_TYPE_12 constants.OMException - if the message doesn't have one of the supported types, i.e. is
neither MTOM nor SOAP with attachmentspublic DataHandler getDataHandler(String blobContentID)
getDataHandler in interface OMAttachmentAccessorblobContentID - (without the surrounding angle brackets and "cid:" prefix)public void addDataHandler(String contentID, DataHandler dataHandler)
contentID - dataHandler - public void removeDataHandler(String blobContentID)
blobContentID - public InputStream getSOAPPartInputStream() throws OMException
OMExceptionpublic String getSOAPPartContentID()
public String getSOAPPartContentType()
public IncomingAttachmentStreams getIncomingAttachmentStreams() throws IllegalStateException
IncomingAttachmentStreamsIllegalStateException - if application has alreadt started using Part's directlypublic String[] getAllContentIDs()
public Set getContentIDSet()
public Map getMap()
DataHandler objects as values.public List getContentIDList()
getAllContentIDs() or getContentIDSet() should be used
instead.public Map getHeaders()
public void setHeaders(Map headers)
headers - Map of MIME headerspublic long getContentLength()
throws IOException
IOExceptionprotected void setEndOfStream(boolean value)
value - public InputStream getIncomingAttachmentsAsSingleStream() throws IllegalStateException
IllegalStateExceptionCopyright © 2004–2021 The Apache Software Foundation. All rights reserved.