public class MimePart
extends java.lang.Object
Encapsulates a MIME part.
Constructor and Description |
---|
MimePart() |
Modifier and Type | Method and Description |
---|---|
MimeStreamReader |
getContent()
Return MIME part content, or request/response content if
isRequest or isResponse is true . |
java.lang.String |
getContentID()
Return (nullable) Body part Content-ID for body part in OData change set request/response, otherwise null.
|
HttpHeaders |
getHeaders()
Return MIME part headers, or request/response headers if
isRequest or isResponse is true . |
java.lang.String |
getHttpMethod()
Return if
MimePart.isRequest is true , then the HTTP method (e.g. |
java.lang.String |
getRequestURI()
Return if
MimePart.isRequest is true , then the request URI (e.g. |
int |
getStatusCode()
Return if
MimePart.isResponse is true , then the status code, otherwise zero. |
java.lang.String |
getStatusText()
Return if
MimePart.isResponse is true , then the status text, otherwise empty. |
boolean |
isMultipart()
Return
true if this part contains a multipart message (part's Content-Type is "multipart/mixed; boundary=SomeBoundaryText"). |
boolean |
isRequest()
Return
true if this part contains an HTTP request (part's Content-Type is "application/http", and is followed by an HTTP request line). |
boolean |
isResponse()
Return tr
ue if this part contains an HTTP response (part's Content-Type is "application/http", and is followed by an HTTP status line). |
void |
setContent(MimeStreamReader value)
Set MIME part content, or request/response content if
isRequest or isResponse is true . |
void |
setContentID(java.lang.String value)
Set body part Content-ID for body part in OData change set request/response, otherwise null.
|
void |
setHeaders(HttpHeaders value)
Set MIME part headers, or request/response headers if
isRequest or isResponse is true . |
void |
setHttpMethod(java.lang.String value)
Set if
MimePart.isRequest is true , then the HTTP method (e.g. |
void |
setMultipart(boolean value)
Set
true if this part contains a multipart message (part's Content-Type is "multipart/mixed; boundary=SomeBoundaryText"). |
void |
setRequest(boolean value)
Set
true if this part contains an HTTP request (part's Content-Type is "application/http", and is followed by an HTTP request line). |
void |
setRequestURI(java.lang.String value)
Set if
MimePart.isRequest is true , then the request URI (e.g. |
void |
setResponse(boolean value)
Set tr
ue if this part contains an HTTP response (part's Content-Type is "application/http", and is followed by an HTTP status line). |
void |
setStatusCode(int value)
Set if
MimePart.isResponse is true , then the status code, otherwise zero. |
void |
setStatusText(java.lang.String value)
Set if
MimePart.isResponse is true , then the status text, otherwise empty. |
public MimeStreamReader getContent()
Return MIME part content, or request/response content if isRequest
or isResponse
is true
.
isRequest
or isResponse
is true
.public java.lang.String getContentID()
Return (nullable) Body part Content-ID for body part in OData change set request/response, otherwise null.
public HttpHeaders getHeaders()
Return MIME part headers, or request/response headers if isRequest
or isResponse
is true
.
isRequest
or isResponse
is true
.public java.lang.String getHttpMethod()
Return if MimePart.isRequest
is true
, then the HTTP method (e.g. "GET"), otherwise empty.
MimePart.isRequest
is true
, then the HTTP method (e.g. "GET"), otherwise empty.public java.lang.String getRequestURI()
Return if MimePart.isRequest
is true
, then the request URI (e.g. "/resource"), otherwise empty.
MimePart.isRequest
is true
, then the request URI (e.g. "/resource"), otherwise empty.public int getStatusCode()
Return if MimePart.isResponse
is true
, then the status code, otherwise zero.
MimePart.isResponse
is true
, then the status code, otherwise zero.public java.lang.String getStatusText()
Return if MimePart.isResponse
is true
, then the status text, otherwise empty.
MimePart.isResponse
is true
, then the status text, otherwise empty.public boolean isMultipart()
Return true
if this part contains a multipart message (part's Content-Type is "multipart/mixed; boundary=SomeBoundaryText").
true
if this part contains a multipart message (part's Content-Type is "multipart/mixed; boundary=SomeBoundaryText").public boolean isRequest()
Return true
if this part contains an HTTP request (part's Content-Type is "application/http", and is followed by an HTTP request line).
true
if this part contains an HTTP request (part's Content-Type is "application/http", and is followed by an HTTP request line).public boolean isResponse()
Return true if this part contains an HTTP response (part's Content-Type is "application/http", and is followed by an HTTP status line). @return tr
ue if this part contains an HTTP response (part's Content-Type is "application/http", and is followed by an HTTP status line).
public void setContent(MimeStreamReader value)
Set MIME part content, or request/response content if isRequest
or isResponse
is true
.
value
- MIME part content, or request/response content if isRequest
or isResponse
is true
.public void setContentID(java.lang.String value)
Set body part Content-ID for body part in OData change set request/response, otherwise null.
value
- Body part Content-ID for body part in OData change set request/response, otherwise null.public void setHeaders(HttpHeaders value)
Set MIME part headers, or request/response headers if isRequest
or isResponse
is true
.
value
- MIME part headers, or request/response headers if isRequest
or isResponse
is true
.public void setHttpMethod(java.lang.String value)
Set if MimePart.isRequest
is true
, then the HTTP method (e.g. "GET"), otherwise empty.
value
- If MimePart.isRequest
is true
, then the HTTP method (e.g. "GET"), otherwise empty.public void setMultipart(boolean value)
Set true
if this part contains a multipart message (part's Content-Type is "multipart/mixed; boundary=SomeBoundaryText").
value
- true
if this part contains a multipart message (part's Content-Type is "multipart/mixed; boundary=SomeBoundaryText").public void setRequest(boolean value)
Set true
if this part contains an HTTP request (part's Content-Type is "application/http", and is followed by an HTTP request line).
value
- true
if this part contains an HTTP request (part's Content-Type is "application/http", and is followed by an HTTP request line).public void setRequestURI(java.lang.String value)
Set if MimePart.isRequest
is true
, then the request URI (e.g. "/resource"), otherwise empty.
value
- If MimePart.isRequest
is true
, then the request URI (e.g. "/resource"), otherwise empty.public void setResponse(boolean value)
Set true if this part contains an HTTP response (part's Content-Type is "application/http", and is followed by an HTTP status line). @param value tr
ue if this part contains an HTTP response (part's Content-Type is "application/http", and is followed by an HTTP status line).
public void setStatusCode(int value)
Set if MimePart.isResponse
is true
, then the status code, otherwise zero.
value
- If MimePart.isResponse
is true
, then the status code, otherwise zero.public void setStatusText(java.lang.String value)
Set if MimePart.isResponse
is true
, then the status text, otherwise empty.
value
- If MimePart.isResponse
is true
, then the status text, otherwise empty.