public class MessageBody
extends java.lang.Object
implements com.opencloud.rhino.cmp.Encodable
Constructor and Description |
---|
MessageBody(ContentType contentType,
byte[] content) |
MessageBody(java.io.DataInput in,
java.lang.ClassLoader cl,
com.opencloud.rhino.cmp.codecs.DecoderUtils utils) |
MessageBody(java.lang.String contentType,
byte[] content) |
Modifier and Type | Method and Description |
---|---|
void |
encode(java.io.DataOutput out,
com.opencloud.rhino.cmp.codecs.EncoderUtils utils) |
boolean |
equals(java.lang.Object o) |
byte[] |
getContent() |
java.lang.String |
getContentAsString()
Best effort at getting the content as a string, using the specified encoding from the content type.
|
java.lang.String |
getContentDisposition() |
java.lang.String |
getContentType() |
ContentType |
getContentTypeObject() |
boolean |
hasContentDisposition() |
int |
hashCode() |
boolean |
matchesContentType(java.lang.String type)
Matches the content type and sub-type, parameters are ignored
|
void |
setContent(byte[] content) |
void |
setContentDisposition(java.lang.String contentDisposition) |
void |
setContentType(ContentType contentType) |
void |
setContentType(java.lang.String contentType) |
java.lang.String |
toString() |
public MessageBody(@Nonnull java.lang.String contentType, @Nonnull byte[] content) throws java.io.IOException
java.io.IOException
public MessageBody(@Nonnull ContentType contentType, @Nonnull byte[] content)
public MessageBody(java.io.DataInput in, java.lang.ClassLoader cl, com.opencloud.rhino.cmp.codecs.DecoderUtils utils) throws java.io.IOException
java.io.IOException
public void encode(java.io.DataOutput out, com.opencloud.rhino.cmp.codecs.EncoderUtils utils) throws java.io.IOException
encode
in interface com.opencloud.rhino.cmp.Encodable
java.io.IOException
public java.lang.String getContentType()
public ContentType getContentTypeObject()
public void setContentType(@Nonnull java.lang.String contentType) throws java.io.IOException
java.io.IOException
public void setContentType(@Nonnull ContentType contentType)
public java.lang.String getContentDisposition()
public void setContentDisposition(java.lang.String contentDisposition)
public boolean hasContentDisposition()
public byte[] getContent()
public java.lang.String getContentAsString()
public void setContent(@Nonnull byte[] content)
public boolean matchesContentType(java.lang.String type)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
Copyright © OpenCloud. All Rights Reserved.