org.apache.axiom.attachments
Interface Part

All Known Implementing Classes:
PartOnFile, PartOnMemory, PartOnMemoryEnhanced

public interface Part

Abstract for Part. A Part can be the SOAP Part or an Attachment Part. There are several implementations for part, which are optimized for space and time. A Part is created with the PartFactory.

See Also:
PartFactory

Method Summary
 void addHeader(java.lang.String name, java.lang.String value)
          Add a Header (name, value) to the part
 java.util.Enumeration getAllHeaders()
           
 java.lang.String getContentID()
           
 java.lang.String getContentType()
           
 javax.activation.DataHandler getDataHandler()
           
 java.lang.String getFileName()
          Deprecated. The callers should not no how the part is implemented.
 java.lang.String getHeader(java.lang.String name)
          Get the value of a specific header
 java.io.InputStream getInputStream()
           
 long getSize()
           
 

Method Detail

getDataHandler

javax.activation.DataHandler getDataHandler()
                                            throws javax.mail.MessagingException
Returns:
DataHandler representing this part
Throws:
javax.mail.MessagingException

getSize

long getSize()
             throws javax.mail.MessagingException
Returns:
size
Throws:
javax.mail.MessagingException

getContentType

java.lang.String getContentType()
                                throws javax.mail.MessagingException
Returns:
content type of the part
Throws:
javax.mail.MessagingException

getContentID

java.lang.String getContentID()
                              throws javax.mail.MessagingException
Returns:
content id of the part
Throws:
javax.mail.MessagingException

getFileName

java.lang.String getFileName()
                             throws javax.mail.MessagingException
Deprecated. The callers should not no how the part is implemented.

The part may be backed by a file. If that is the case, this method returns the file name.

Returns:
Throws:
javax.mail.MessagingException

getInputStream

java.io.InputStream getInputStream()
                                   throws java.io.IOException,
                                          javax.mail.MessagingException
Returns:
Get the part data as an input stream
Throws:
java.io.IOException
javax.mail.MessagingException

addHeader

void addHeader(java.lang.String name,
               java.lang.String value)
               throws javax.mail.MessagingException
Add a Header (name, value) to the part

Parameters:
name -
value -
Throws:
javax.mail.MessagingException

getHeader

java.lang.String getHeader(java.lang.String name)
                           throws javax.mail.MessagingException
Get the value of a specific header

Parameters:
name -
Returns:
value or null
Throws:
javax.mail.MessagingException

getAllHeaders

java.util.Enumeration getAllHeaders()
                                    throws javax.mail.MessagingException
Returns:
Enumeration of javax.mail.Header
Throws:
javax.mail.MessagingException


Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.