org.apache.axis.attachments
public class AttachmentsImpl extends Object implements Attachments
Field Summary | |
---|---|
protected String | contentLocation
This is the content location as specified in SOAP with Attachments.
|
protected static Log | log |
protected MultiPartInputStream | mpartStream
The actual stream to manage the multi-related input stream. |
protected int | sendtype
The form of the attachments, whether MIME or DIME. |
protected SOAPPart | soapPart Field soapPart. |
Constructor Summary | |
---|---|
AttachmentsImpl(Object intialContents, String contentType, String contentLocation)
Construct one of these on a parent Message.
|
Method Summary | |
---|---|
Part | addAttachmentPart(Part newPart)
Adds an existing attachment to this list.
|
Part | createAttachmentPart(Object datahandler) |
Part | createAttachmentPart()
Create a new attachment Part in this Message.
|
protected DimeMultiPart | createDimeMessage()
Creates the DIME message
|
void | dispose()
dispose of the attachments and their files; do not use the object
after making this call. |
Part | getAttachmentByReference(String reference)
This method should look at a refernce and determine if it is a CID: or
url to look for attachment.
|
int | getAttachmentCount()
This is the number of attachments.
|
Collection | getAttachments()
This method will return all attachments as a collection.
|
Iterator | getAttachments(MimeHeaders headers)
Retrieves all the AttachmentPart objects
that have header entries that match the specified headers.
|
long | getContentLength()
Get the content length of the stream.
|
String | getContentType()
Gets the content type for the whole stream.
|
Part | getRootPart()
From the complex stream return the root part.
|
int | getSendType() |
static int | getSendType(String value)
Determine how an object typically sent as attachments are to
be represented. |
static String | getSendTypeString(int value)
For a given sendType value, return a string representation.
|
boolean | isAttachment(Object value)
Determine if an object is to be treated as an attchment.
|
void | removeAllAttachments()
Removes all AttachmentPart objects that have
been added to this SOAPMessage object.
|
Part | removeAttachmentPart(String reference)
This method uses getAttacmentByReference() to look for attachment.
|
void | setAttachmentParts(Collection parts)
Add the collection of parts.
|
void | setRootPart(Part newRoot) |
void | setSendType(int sendtype) |
void | writeContentToStream(OutputStream os)
Write the content to the stream.
|
Parameters: intialContents should be anything but today only a stream is supported. contentType The mime content type of the stream for transports that provide it. contentLocation
Throws: org.apache.axis.AxisFault
Parameters: newPart new part to add
Returns: Part old attachment with the same Content-ID, or null.
Throws: org.apache.axis.AxisFault
Returns: a new attachment Part
Throws: org.apache.axis.AxisFault
Returns: a DIME part
Throws: org.apache.axis.AxisFault if the part could not be built
Parameters: reference The reference in the xml that referers to an attachment.
Returns: The part associated with the attachment.
Throws: org.apache.axis.AxisFault
Returns: the number of attachments
Returns: A collection of attachments.
Throws: org.apache.axis.AxisFault
AttachmentPart
objects
that have header entries that match the specified headers.
Note that a returned attachment could have headers in
addition to those specified.Parameters: headers a MimeHeaders
object containing the MIME headers for which to
search
Returns: an iterator over all attachments that have a header that matches one of the given headers
Returns: the content length of the stream
Throws: org.apache.axis.AxisFault
Returns: the content type for the whole stream
Throws: org.apache.axis.AxisFault
Returns: the root Part
Parameters: value a String representing a sending type, treated in a case-insensetive manner
Returns: an int
send type code
Parameters: value a type code integer
Returns: a String
representation of value
Parameters: value the value that is to be determined if its an attachment.
Returns: True if value should be treated as an attchment.
AttachmentPart
objects that have
been added to this SOAPMessage
object.
This method does not touch the SOAP part.
Parameters: reference The reference that referers to an attachment.
Returns: The part associated with the removed attachment, or null.
Throws: org.apache.axis.AxisFault
Parameters: parts
Throws: org.apache.axis.AxisFault
Parameters: os
Throws: org.apache.axis.AxisFault