Class PartOnMemoryEnhanced

  • All Implemented Interfaces:
    Part

    public class PartOnMemoryEnhanced
    extends 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:
    PartFactory
    • Method Detail

      • getDataHandler

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

        public 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:
        the name of the file
        Throws:
        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​(String name,
                              String value)
        Description copied from interface: Part
        Add a Header (name, value) to the part
        Specified by:
        addHeader in interface Part
      • getAllHeaders

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

        public String getHeader​(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 String getContentID()
                            throws javax.mail.MessagingException
        Specified by:
        getContentID in interface Part
        Returns:
        content id of the part
        Throws:
        javax.mail.MessagingException
      • getContentType

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

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