org.apache.axiom.attachments.impl
Class PartOnMemoryEnhanced

java.lang.Object
  extended by org.apache.axiom.attachments.impl.PartOnMemoryEnhanced
All Implemented Interfaces:
Part

public class PartOnMemoryEnhanced
extends java.lang.Object

PartOnMemoryEnhanced stores the attachment in memory (in non-contigous byte arrays) This implementation is used for smaller attachments to enhance performance. The PartOnMemoryEnhanced object is created by the PartFactory

See Also:
org.apache.axiom.attachments.impl.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 getContentTransferEncoding()
           
 java.lang.String getContentType()
           
 javax.activation.DataHandler getDataHandler()
           
 java.lang.String getFileName()
          The part may be backed by a file.
 java.lang.String getHeader(java.lang.String name)
          Get the value of a specific header
 java.io.InputStream getInputStream()
           
 long getSize()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDataHandler

public javax.activation.DataHandler getDataHandler()
                                            throws javax.mail.MessagingException
Specified by:
getDataHandler in interface Part
Returns:
DataHandler representing this part
Throws:
javax.mail.MessagingException

getFileName

public java.lang.String getFileName()
                             throws javax.mail.MessagingException
Description copied from interface: Part
The part may be backed by a file. If that is the case, this method returns the file name.

Specified by:
getFileName in interface Part
Returns:
Throws:
javax.mail.MessagingException

getInputStream

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

getSize

public long getSize()
             throws javax.mail.MessagingException
Specified by:
getSize in interface Part
Returns:
size
Throws:
javax.mail.MessagingException

addHeader

public void addHeader(java.lang.String name,
                      java.lang.String value)
Description copied from interface: Part
Add a Header (name, value) to the part

Specified by:
addHeader in interface Part

getAllHeaders

public java.util.Enumeration getAllHeaders()
                                    throws javax.mail.MessagingException
Specified by:
getAllHeaders in interface Part
Returns:
Enumeration of javax.mail.Header
Throws:
javax.mail.MessagingException

getHeader

public java.lang.String getHeader(java.lang.String name)
Description copied from interface: Part
Get the value of a specific header

Specified by:
getHeader in interface Part
Returns:
value or null

getContentID

public java.lang.String getContentID()
                              throws javax.mail.MessagingException
Specified by:
getContentID in interface Part
Returns:
content id of the part
Throws:
javax.mail.MessagingException

getContentType

public java.lang.String getContentType()
                                throws javax.mail.MessagingException
Specified by:
getContentType in interface Part
Returns:
content type of the part
Throws:
javax.mail.MessagingException

getContentTransferEncoding

public java.lang.String getContentTransferEncoding()
                                            throws javax.mail.MessagingException
Returns:
contentTransferEncoding
Throws:
javax.mail.MessagingException


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