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 Entity
body
- the body.IllegalStateException
- if the body has already been set.public Body removeBody()
disposed
of.removeBody
in interface Entity
null
if no body was set.public String getMimeType()
Entity
Entity
. 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 Entity
public String getCharset()
Entity
.getCharset
in interface Entity
public String getContentTransferEncoding()
Entity
.getContentTransferEncoding
in interface Entity
public String getDispositionType()
Entity
.getDispositionType
in interface Entity
null
if no disposition
type has been set.public String getFilename()
Entity
.getFilename
in interface Entity
null
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 Entity
true
on match, false
otherwise.public void dispose()
dispose
in interface Disposable
Disposable.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.