Methods Summary |
---|
public Body | getBody()Gets the body of this entity.
return body;
|
public java.lang.String | getCharset()Determines the MIME character set encoding of this Entity .
return ContentTypeField.getCharset(
(ContentTypeField) getHeader().getField(Field.CONTENT_TYPE));
|
public java.lang.String | getContentTransferEncoding()Determines the transfer encoding of this Entity .
ContentTransferEncodingField f = (ContentTransferEncodingField)
getHeader().getField(Field.CONTENT_TRANSFER_ENCODING);
return ContentTransferEncodingField.getEncoding(f);
|
public Header | getHeader()Gets the entity header.
return header;
|
public java.lang.String | getMimeType()Determines the MIME type of this 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 .
ContentTypeField child =
(ContentTypeField) getHeader().getField(Field.CONTENT_TYPE);
ContentTypeField parent = getParent() != null
? (ContentTypeField) getParent().getHeader().
getField(Field.CONTENT_TYPE)
: null;
return ContentTypeField.getMimeType(child, parent);
|
public org.apache.james.mime4j.message.Entity | getParent()Gets the parent entity of this entity.
Returns null if this is the root entity.
return parent;
|
public boolean | isMimeType(java.lang.String type)Determines if the MIME type of this Entity matches the
given one. MIME types are case-insensitive.
return getMimeType().equalsIgnoreCase(type);
|
public boolean | isMultipart()Determines if the MIME type of this Entity is
multipart/* . Since multipart-entities must have
a boundary parameter in the Content-Type field this
method returns false if no boundary exists.
ContentTypeField f =
(ContentTypeField) getHeader().getField(Field.CONTENT_TYPE);
return f != null && f.getBoundary() != null
&& getMimeType().startsWith(ContentTypeField.TYPE_MULTIPART_PREFIX);
|
public void | setBody(Body body)Sets the body of this entity.
this.body = body;
body.setParent(this);
|
public void | setHeader(Header header)Sets the entity header.
this.header = header;
|
public void | setParent(org.apache.james.mime4j.message.Entity parent)Sets the parent entity of this entity.
this.parent = parent;
|
public abstract void | writeTo(java.io.OutputStream out)Write the content to the given outputstream
|