org.apache.axis.attachments
Interface Attachments
- java.io.Serializable
- AttachmentsImpl
public interface Attachments
extends java.io.Serializable
Access the Attachments of a Message. This interface essentially
firewalls the rest of Axis from any dependencies on javax.activation.
If javax.activation is not available, this is the *only* class that
will be compiled in org.apache.axis.attachments.
- Rob Jellinghaus (robj@unrealities.com)
- Rick Rineholt
CIDprefix
public static final String CIDprefix
The prefix used to assoc. attachments as content-id
SEND_TYPE_DEFAULT
public static final int SEND_TYPE_DEFAULT
The default attatchment type. MIME
SEND_TYPE_DIME
public static final int SEND_TYPE_DIME
Use the DIME attatchment type.
SEND_TYPE_MAX
public static final int SEND_TYPE_MAX
SEND_TYPE_MIME
public static final int SEND_TYPE_MIME
Use the SOAP with MIME attatchment send type.
SEND_TYPE_MTOM
public static final int SEND_TYPE_MTOM
Use the MTOM attatchment type.
SEND_TYPE_NONE
public static final int SEND_TYPE_NONE
Use the DIME attatchment type.
SEND_TYPE_NOTSET
public static final int SEND_TYPE_NOTSET
Use the default attatchment send type.
addAttachmentPart
public Part addAttachmentPart(Part newPart)
throws AxisFault
Adds an existing attachment to this list.
Note: Passed part will be bound to this message.
newPart
- new part to add
- Part old attachment with the same Content-ID, or null.
createAttachmentPart
public Part createAttachmentPart()
throws AxisFault
Create a new attachment Part in this Message.
Will actually, and always, return an AttachmentPart.
createAttachmentPart
public Part createAttachmentPart(Object part)
throws AxisFault
Create a new attachment Part in this Message.
Will actually, and always, return an AttachmentPart.
part
- The part that is referenced
dispose
public void dispose()
dispose of the attachments and their files; do not use the object
after making this call.
getAttachmentByReference
public Part getAttachmentByReference(String reference)
throws AxisFault
This method should look at a refernce and determine if it is a CID: or url
to look for attachment.
reference
- The reference in the xml that referers to an attachment.
- The part associated with the attachment.
getAttachmentCount
public int getAttachmentCount()
This is the number of attachments.
- the number of attachments
getAttachments
public java.util.Collection getAttachments()
throws AxisFault
This method will return all attachments as a collection.
- A collection of attachments.
getAttachments
public java.util.Iterator getAttachments(MimeHeaders headers)
Retrieves all the AttachmentPart
objects
that have header entries that match the specified headers.
Note that a returned attachment could have headers in
addition to those specified.
headers
- a MimeHeaders
object containing the MIME headers for which to
search
- an iterator over all attachments that have a header
that matches one of the given headers
getContentLength
public long getContentLength()
throws AxisFault
Get the content length of the stream.
getContentType
public String getContentType()
throws AxisFault
Write the content to the stream.
getIncomingAttachmentStreams
public IncomingAttachmentStreams getIncomingAttachmentStreams()
Once this method is called, attachments can only be accessed via the InputStreams.
Any other access to the attachments collection (e.g. via getAttachments()) is
prohibited and will cause a ConcurrentModificationException to be thrown.
- All of the attachment streams.
getRootPart
public Part getRootPart()
From the complex stream return the SOAP part.
- will return the root part if the stream is supported,
otherwise null.
getSendType
public int getSendType()
Determine if an object is to be treated as an attchment.
- SEND_TYPE_MIME, SEND_TYPE_DIME, SEND_TYPE_NOTSET
isAttachment
public boolean isAttachment(Object value)
Determine if an object is to be treated as an attchment.
value
- the value that is to be determined if
its an attachment.
- True if value should be treated as an attchment.
removeAllAttachments
public void removeAllAttachments()
Removes all
AttachmentPart
objects that have
been added to this
SOAPMessage
object.
This method does not touch the SOAP part.
removeAttachmentPart
public Part removeAttachmentPart(String reference)
throws AxisFault
This method uses getAttacmentByReference() to look for attachment.
If attachment has been found, it will be removed from the list, and
returned to the user.
reference
- The reference that referers to an attachment.
- The part associated with the removed attachment, or null.
setAttachmentParts
public void setAttachmentParts(java.util.Collection parts)
throws AxisFault
Will the attachments of this message to that of the colleciton.
setRootPart
public void setRootPart(Part newRoot)
Sets the root part of this multipart block
newRoot
- the new root Part
setSendType
public void setSendType(int sendtype)
Set the format for attachments.
sendtype
- the format to send.
SEND_TYPE_MIME for Multipart Releated Mail type attachments.
SEND_TYPE_DIME for DIME type attachments.
writeContentToStream
public void writeContentToStream(java.io.OutputStream os)
throws AxisFault
Write the content to the stream.
Copyright B) 2005 Apache Web Services Project. All Rights Reserved.