Interface Entity
- All Superinterfaces:
Disposable
- All Known Subinterfaces:
Message
- All Known Implementing Classes:
AbstractEntity, AbstractMessage, BodyPart, MessageImpl
A MIME entity. An entity has a header and a body (as defined in RFC 2045).
-
Method Summary
Modifier and TypeMethodDescriptiongetBody()Gets the body of this entity.Determines the MIME character set encoding of thisEntity.Determines the transfer encoding of thisEntity.Return the disposition type of the content disposition of thisEntity.Returns the filename parameter of the content disposition of thisEntity.Gets the entity header.Determines the MIME type of thisEntity.Gets the parent entity of this entity.booleanDetermines if the MIME type of thisEntityismultipart/*.Removes and returns the body of this entity.voidSets the body of this entity.voidSets the entity header.voidSets the parent entity of this entity.Methods inherited from interface Disposable
dispose
-
Method Details
-
getParent
Entity getParent()Gets the parent entity of this entity. Returnsnullif this is the root entity.- Returns:
- the parent or
null.
-
setParent
Sets the parent entity of this entity.- Parameters:
parent- the parent entity ornullif this will be the root entity.
-
getHeader
-
setHeader
-
getBody
-
setBody
Sets the body of this entity.- Parameters:
body- the body.- Throws:
IllegalStateException- if the body has already been set.
-
removeBody
-
isMultipart
boolean isMultipart()Determines if the MIME type of thisEntityismultipart/*. Since multipart-entities must have a boundary parameter in theContent-Typefield this method returnsfalseif no boundary exists.- Returns:
trueon match,falseotherwise.
-
getMimeType
String getMimeType()Determines the MIME type of thisEntity. The MIME type is derived by looking at the parent's Content-Type field if no Content-Type field is set for thisEntity.- Returns:
- the MIME type.
-
getCharset
String getCharset()Determines the MIME character set encoding of thisEntity.- Returns:
- the MIME character set encoding.
-
getContentTransferEncoding
String getContentTransferEncoding()Determines the transfer encoding of thisEntity.- Returns:
- the transfer encoding.
-
getDispositionType
String getDispositionType()Return the disposition type of the content disposition of thisEntity.- Returns:
- the disposition type or
nullif no disposition type has been set.
-
getFilename
String getFilename()Returns the filename parameter of the content disposition of thisEntity.- Returns:
- the filename parameter of the content disposition or
nullif the filename has not been set.
-