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(String name, String value)
          Add a Header (name, value) to the part
 Enumeration getAllHeaders()
           
 String getContentID()
           
 String getContentType()
           
 DataHandler getDataHandler()
           
 String getFileName()
          Deprecated. The callers should not no how the part is implemented.
 String getHeader(String name)
          Get the value of a specific header
 InputStream getInputStream()
           
 long getSize()
           
 

Method Detail

getDataHandler

DataHandler getDataHandler()
                           throws MessagingException
Returns:
DataHandler representing this part
Throws:
MessagingException

getSize

long getSize()
             throws MessagingException
Returns:
size
Throws:
MessagingException

getContentType

String getContentType()
                      throws MessagingException
Returns:
content type of the part
Throws:
MessagingException

getContentID

String getContentID()
                    throws MessagingException
Returns:
content id of the part
Throws:
MessagingException

getFileName

String getFileName()
                   throws 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:
the name of the file
Throws:
MessagingException

getInputStream

InputStream getInputStream()
                           throws IOException,
                                  MessagingException
Returns:
Get the part data as an input stream
Throws:
IOException
MessagingException

addHeader

void addHeader(String name,
               String value)
               throws MessagingException
Add a Header (name, value) to the part

Parameters:
name -
value -
Throws:
MessagingException

getHeader

String getHeader(String name)
                 throws MessagingException
Get the value of a specific header

Parameters:
name -
Returns:
value or null
Throws:
MessagingException

getAllHeaders

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


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