org.apache.axis.attachments
Interface Attachments

All Known Implementing Classes:
AttachmentsImpl

public interface Attachments

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), Rick Rineholt

Method Summary
 Part addAttachmentPart(Part newPart)
          Adds an existing attachment to this list.
 Part createAttachmentPart(java.lang.Object part)
          Create a new attachment Part in this Message.
 Part getAttachmentByReference(java.lang.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.
 java.util.Collection getAttachments()
          This method will return all attachments as a collection.
 int getContentLength()
          Get the content length of the stream.
 java.lang.String getContentType()
          Write the content to the stream.
 Part getRootPart()
          From the complex stream return the SOAP part.
 boolean isAttachment(java.lang.Object value)
          Determine if an object is to be treated as an attchment.
 Part removeAttachmentPart(java.lang.String reference)
          This method uses getAttacmentByReference() to look for attachment.
 void setAttachmentParts(java.util.Collection parts)
          Will the attachments of this message to that of the colleciton.
 void setRootPart(Part newRoot)
          Sets the root part of this multipart block
 void writeContentToStream(java.io.OutputStream os)
          Write the content to the stream.
 

Method Detail

addAttachmentPart

public Part addAttachmentPart(Part newPart)
                       throws AxisFault
Adds an existing attachment to this list. Note: Passed part will be bound to this message.
Parameters:
newPart - new part to add
Throws:
AxisFault -  

removeAttachmentPart

public Part removeAttachmentPart(java.lang.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.
Parameters:
The - reference that referers to an attachment.
Returns:
The part associated with the removed attachment, or null.

getAttachmentByReference

public Part getAttachmentByReference(java.lang.String reference)
                              throws AxisFault
This method should look at a refernce and determine if it is a CID: or url to look for attachment.
Parameters:
The - reference in the xml that referers to an attachment.
Returns:
The part associated with the attachment.

getAttachments

public java.util.Collection getAttachments()
                                    throws AxisFault
This method will return all attachments as a collection.
Returns:
A collection of attachments.

createAttachmentPart

public Part createAttachmentPart(java.lang.Object part)
                          throws AxisFault
Create a new attachment Part in this Message. Will actually, and always, return an AttachmentPart.
Parameters:
The - part that is referenced

setAttachmentParts

public void setAttachmentParts(java.util.Collection parts)
                        throws AxisFault
Will the attachments of this message to that of the colleciton.

getRootPart

public Part getRootPart()
From the complex stream return the SOAP part.
Returns:
will return the root part if the stream is supported, otherwise null.

setRootPart

public void setRootPart(Part newRoot)
Sets the root part of this multipart block

getContentLength

public int getContentLength()
                     throws AxisFault
Get the content length of the stream.

writeContentToStream

public void writeContentToStream(java.io.OutputStream os)
                          throws AxisFault
Write the content to the stream.

getContentType

public java.lang.String getContentType()
                                throws AxisFault
Write the content to the stream.

getAttachmentCount

public int getAttachmentCount()
This is the number of attachments.

isAttachment

public boolean isAttachment(java.lang.Object value)
Determine if an object is to be treated as an attchment.
Parameters:
value - the value that is to be determined if its an attachment.
Returns:
True if value should be treated as an attchment.


Copyright © 2001 Apache XML Project. All Rights Reserved.