|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.monoserv.http.HttpBody
public class HttpBody
Constructor Summary | |
---|---|
protected |
HttpBody()
|
Method Summary | |
---|---|
byte[] |
getData()
Returns the data that was stored internally for the message body. |
java.lang.String |
getEncoding()
Returns the encoding to use |
java.lang.String |
getStringData()
Returns the data that was stored internally for the message body as a string. |
boolean |
isDataString()
Returns the boolean flag set if the data set inside the HttpBody object if the data is to be used a binary or text |
static HttpBody |
make(byte[] data)
Creates a base HttpBody object with the supplied data as a byte array in the body. |
static HttpBody |
make(java.lang.String data)
Creates a base HttpBody object with the supplied data as a byte array in the body. |
static HttpBody |
makeBlank()
Creates a base HttpBody object with nothing for the body content. |
void |
setBody(byte[] data)
This will actually set the internal byte array as the message body |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected HttpBody()
Method Detail |
---|
public static HttpBody makeBlank()
HttpBody obj = new HttpBody();
obj.SetBody("");
return obj;
public static HttpBody make(byte[] data)
HttpBody obj = new HttpBody();
obj.SetBody(data);
return obj;
data
- The data you want to store as the message body
public static HttpBody make(java.lang.String data)
HttpBody obj = new HttpBody();
obj.SetBody(data.getBytes());
return obj;
data
- The data you want to store as the message body
public void setBody(byte[] data) throws java.lang.NullPointerException
data
- A byte array containing the raw data to keep as the body.
java.lang.NullPointerException
- If the supplied data is null.public byte[] getData() throws java.lang.NullPointerException
java.lang.NullPointerException
- If the internal array is nullpublic java.lang.String getStringData() throws java.lang.NullPointerException, java.io.UnsupportedEncodingException
java.lang.NullPointerException
- If the internal array is null
java.io.UnsupportedEncodingException
public boolean isDataString()
public java.lang.String getEncoding()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |