- java.lang.Object
-
- jakarta.mail.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".
- Author:
- John Mani, Bill Shannon
-
-
Field Summary
Fields Modifier and Type Field Description protected Multipart
parent
TheMultipart
object containing thisBodyPart
, if known.-
Fields inherited from interface jakarta.mail.Part
ATTACHMENT, INLINE
-
-
Constructor Summary
Constructors Constructor Description BodyPart()
Creates a defaultBodyPart
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Multipart
getParent()
Return the containingMultipart
object, ornull
if not known.StreamProvider
getStreamProvider()
Obtains theStreamProvider
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jakarta.mail.Part
addHeader, getAllHeaders, getContent, getContentType, getDataHandler, getDescription, getDisposition, getFileName, getHeader, getInputStream, getLineCount, getMatchingHeaders, getNonMatchingHeaders, getSize, isMimeType, removeHeader, setContent, setContent, setDataHandler, setDescription, setDisposition, setFileName, setHeader, setText, writeTo
-
-
-
-
Field Detail
-
parent
protected Multipart parent
TheMultipart
object containing thisBodyPart
, if known.
-
-
Method Detail
-
getParent
public Multipart getParent()
Return the containingMultipart
object, ornull
if not known.- Returns:
- the parent Multipart
-
getStreamProvider
public StreamProvider getStreamProvider() throws MessagingException
Description copied from interface:Part
Obtains theStreamProvider
. It defaults toSession.getDefaultInstance(java.util.Properties, Authenticator)
.- Specified by:
getStreamProvider
in interfacePart
- Returns:
- the StreamProvider.
- Throws:
MessagingException
- if errors.
-
-