FileDocCategorySizeDatePackage
Attachments.javaAPI DocApache Axis 1.47685Sat Apr 22 18:57:28 BST 2006org.apache.axis.attachments

Attachments

public interface Attachments implements 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.

author
Rob Jellinghaus (robj@unrealities.com)
author
Rick Rineholt

Fields Summary
public final int
SEND_TYPE_NOTSET
Use the default attatchment send type.
public final int
SEND_TYPE_MIME
Use the SOAP with MIME attatchment send type.
public final int
SEND_TYPE_DIME
Use the DIME attatchment type.
public final int
SEND_TYPE_MTOM
Use the MTOM attatchment type.
public final int
SEND_TYPE_NONE
Use the DIME attatchment type.
final int
SEND_TYPE_MAX
final int
SEND_TYPE_DEFAULT
The default attatchment type. MIME
public final String
CIDprefix
The prefix used to assoc. attachments as content-id
Constructors Summary
Methods Summary
public org.apache.axis.PartaddAttachmentPart(org.apache.axis.Part newPart)
Adds an existing attachment to this list. Note: Passed part will be bound to this message.

param
newPart new part to add
return
Part old attachment with the same Content-ID, or null.
throws
org.apache.axis.AxisFault

public org.apache.axis.PartcreateAttachmentPart(java.lang.Object part)
Create a new attachment Part in this Message. Will actually, and always, return an AttachmentPart.

param
part The part that is referenced
return
a new attachment part
throws
org.apache.axis.AxisFault

public org.apache.axis.PartcreateAttachmentPart()
Create a new attachment Part in this Message. Will actually, and always, return an AttachmentPart.

return
a new attachment part
throws
org.apache.axis.AxisFault

public voiddispose()
dispose of the attachments and their files; do not use the object after making this call.

public org.apache.axis.PartgetAttachmentByReference(java.lang.String reference)
This method should look at a refernce and determine if it is a CID: or url to look for attachment.

param
reference The reference in the xml that referers to an attachment.
return
The part associated with the attachment.
throws
org.apache.axis.AxisFault

public intgetAttachmentCount()
This is the number of attachments.

return
the number of attachments

public java.util.CollectiongetAttachments()
This method will return all attachments as a collection.

return
A collection of attachments.
throws
org.apache.axis.AxisFault

public java.util.IteratorgetAttachments(javax.xml.soap.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.

param
headers a MimeHeaders object containing the MIME headers for which to search
return
an iterator over all attachments that have a header that matches one of the given headers

public longgetContentLength()
Get the content length of the stream.

return
the content length of
throws
org.apache.axis.AxisFault

public java.lang.StringgetContentType()
Write the content to the stream.

return
the content type
throws
org.apache.axis.AxisFault

public IncomingAttachmentStreamsgetIncomingAttachmentStreams()
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.

return
All of the attachment streams.

public org.apache.axis.PartgetRootPart()
From the complex stream return the SOAP part.

return
will return the root part if the stream is supported, otherwise null.

public intgetSendType()
Determine if an object is to be treated as an attchment.

return
SEND_TYPE_MIME, SEND_TYPE_DIME, SEND_TYPE_NOTSET

public booleanisAttachment(java.lang.Object value)
Determine if an object is to be treated as an attchment.

param
value the value that is to be determined if its an attachment.
return
True if value should be treated as an attchment.

public voidremoveAllAttachments()
Removes all AttachmentPart objects that have been added to this SOAPMessage object.

This method does not touch the SOAP part.

public org.apache.axis.PartremoveAttachmentPart(java.lang.String reference)
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.

param
reference The reference that referers to an attachment.
return
The part associated with the removed attachment, or null.
throws
org.apache.axis.AxisFault

public voidsetAttachmentParts(java.util.Collection parts)
Will the attachments of this message to that of the colleciton.

param
parts
throws
org.apache.axis.AxisFault

public voidsetRootPart(org.apache.axis.Part newRoot)
Sets the root part of this multipart block

param
newRoot the new root Part

public voidsetSendType(int sendtype)
Set the format for attachments.

param
sendtype the format to send. SEND_TYPE_MIME for Multipart Releated Mail type attachments. SEND_TYPE_DIME for DIME type attachments.

public voidwriteContentToStream(java.io.OutputStream os)
Write the content to the stream.

param
os the stream
throws
org.apache.axis.AxisFault