public abstract class AbstractEntity extends Object implements Entity
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractEntity()
Creates a new
Entity. |
| Modifier and Type | Method and Description |
|---|---|
protected abstract String |
calcCharset(ContentTypeField contentType) |
protected abstract String |
calcMimeType(ContentTypeField child,
ContentTypeField parent) |
protected abstract String |
calcTransferEncoding(ContentTransferEncodingField f) |
void |
dispose()
Disposes of the body of this entity.
|
Body |
getBody()
Gets the body of this entity.
|
String |
getCharset()
Determines the MIME character set encoding of this
Entity. |
String |
getContentTransferEncoding()
Determines the transfer encoding of this
Entity. |
String |
getDispositionType()
Return the disposition type of the content disposition of this
Entity. |
String |
getFilename()
Returns the filename parameter of the content disposition of this
Entity. |
Header |
getHeader()
Gets the entity header.
|
String |
getMimeType()
Determines the MIME type of this
Entity. |
Entity |
getParent()
Gets the parent entity of this entity.
|
boolean |
isMultipart()
Determines if the MIME type of this
Entity is
multipart/*. |
Body |
removeBody()
Removes and returns the body of this entity.
|
void |
setBody(Body body)
Sets the body of this entity.
|
void |
setHeader(Header header)
Sets the entity header.
|
void |
setParent(Entity parent)
Sets the parent entity of this entity.
|
protected AbstractEntity()
Entity. Typically invoked implicitly by a
subclass constructor.public Entity getParent()
null if this is the root entity.public void setParent(Entity parent)
public Header getHeader()
public void setHeader(Header header)
public Body getBody()
public void setBody(Body body)
setBody in interface Entitybody - the body.IllegalStateException - if the body has already been set.public Body removeBody()
disposed of.removeBody in interface Entitynull if no body was set.public String getMimeType()
EntityEntity. The MIME type
is derived by looking at the parent's Content-Type field if no
Content-Type field is set for this Entity.getMimeType in interface Entitypublic String getCharset()
Entity.getCharset in interface Entitypublic String getContentTransferEncoding()
Entity.getContentTransferEncoding in interface Entitypublic String getDispositionType()
Entity.getDispositionType in interface Entitynull if no disposition
type has been set.public String getFilename()
Entity.getFilename in interface Entitynull if the filename has not been set.public boolean isMultipart()
Entity is
multipart/*. Since multipart-entities must have
a boundary parameter in the Content-Type field this
method returns false if no boundary exists.isMultipart in interface Entitytrue on match, false otherwise.public void dispose()
dispose in interface DisposableDisposable.dispose()protected abstract String calcMimeType(ContentTypeField child, ContentTypeField parent)
protected abstract String calcTransferEncoding(ContentTransferEncodingField f)
protected abstract String calcCharset(ContentTypeField contentType)
Copyright © 2004–2023 The Apache Software Foundation. All rights reserved.