Module jakarta.mail
Package jakarta.mail

Class BodyPart

  • All Implemented Interfaces:
    Part
    Direct Known Subclasses:
    MimeBodyPart

    public abstract class BodyPart
    extends java.lang.Object
    implements Part
    This class models a Part that is contained within a Multipart. This is an abstract class. Subclasses provide actual implementations.

    BodyPart implements the Part interface. Thus, it contains a set of attributes and a "content".

    • Field Detail

      • parent

        protected Multipart parent
        The Multipart object containing this BodyPart, if known.
        Since:
        JavaMail 1.1
      • streamProvider

        protected final StreamProvider streamProvider
        Instance of stream provider.
        Since:
        JavaMail 2.1
    • Constructor Detail

      • BodyPart

        public BodyPart()
        Creates a default BodyPart.
    • Method Detail

      • getParent

        public Multipart getParent()
        Return the containing Multipart object, or null if not known.
        Returns:
        the parent Multipart
      • setParent

        void setParent​(Multipart parent)
        Set the parent of this BodyPart to be the specified Multipart. Normally called by Multipart's addBodyPart method. parent may be null if the BodyPart is being removed from its containing Multipart.
        Since:
        JavaMail 1.1