Package org.apache.james.mime4j.dom
Interface Entity
-
- All Superinterfaces:
Disposable
- All Known Subinterfaces:
Message
- All Known Implementing Classes:
AbstractEntity,AbstractMessage,BodyPart,MessageImpl
public interface Entity extends Disposable
A MIME entity. An entity has a header and a body (as defined in RFC 2045).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BodygetBody()Gets the body of this entity.java.lang.StringgetCharset()Determines the MIME character set encoding of thisEntity.java.lang.StringgetContentTransferEncoding()Determines the transfer encoding of thisEntity.java.lang.StringgetDispositionType()Return the disposition type of the content disposition of thisEntity.java.lang.StringgetFilename()Returns the filename parameter of the content disposition of thisEntity.HeadergetHeader()Gets the entity header.java.lang.StringgetMimeType()Determines the MIME type of thisEntity.EntitygetParent()Gets the parent entity of this entity.booleanisMultipart()Determines if the MIME type of thisEntityismultipart/*.BodyremoveBody()Removes and returns the body of this entity.voidsetBody(Body body)Sets the body of this entity.voidsetHeader(Header header)Sets the entity header.voidsetParent(Entity parent)Sets the parent entity of this entity.-
Methods inherited from interface org.apache.james.mime4j.dom.Disposable
dispose
-
-
-
-
Method Detail
-
getParent
Entity getParent()
Gets the parent entity of this entity. Returnsnullif this is the root entity.- Returns:
- the parent or
null.
-
setParent
void setParent(Entity parent)
Sets the parent entity of this entity.- Parameters:
parent- the parent entity ornullif this will be the root entity.
-
getHeader
Header getHeader()
Gets the entity header.- Returns:
- the header.
-
setHeader
void setHeader(Header header)
Sets the entity header.- Parameters:
header- the header.
-
getBody
Body getBody()
Gets the body of this entity.- Returns:
- the body,
-
setBody
void setBody(Body body)
Sets the body of this entity.- Parameters:
body- the body.- Throws:
java.lang.IllegalStateException- if the body has already been set.
-
removeBody
Body removeBody()
Removes and returns the body of this entity. The removed body may be attached to another entity. If it is no longer needed it should bedisposedof.- Returns:
- the removed body or
nullif no body was set.
-
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
java.lang.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
java.lang.String getCharset()
Determines the MIME character set encoding of thisEntity.- Returns:
- the MIME character set encoding.
-
getContentTransferEncoding
java.lang.String getContentTransferEncoding()
Determines the transfer encoding of thisEntity.- Returns:
- the transfer encoding.
-
getDispositionType
java.lang.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
java.lang.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.
-
-