|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.craftforge.essential.client.ClientResponse
public class ClientResponse
A client response is used to provide a normalized response output for a client.
| Constructor Summary | |
|---|---|
ClientResponse(int statusCode,
Map<String,String[]> headers,
InputStream bodyInputStream)
Creates a client response using the given HTTP status code, response headers and response body. |
|
| Method Summary | |
|---|---|
String |
getAuthorizationPassword()
Gets the password from the authorization header. |
String |
getAuthorizationUser()
Gets the user from the authorization header. |
String |
getBodyContent()
Gets the HTTP response body string. |
InputStream |
getBodyInputStream()
Gets the HTTP response body input stream. |
Object |
getBodyObject(Consumer consumer,
Class<?> clazz)
Gets the HTTP response body as an object of the given class. |
String |
getContentCharset()
Gets the response body's charset encoding from the Content-Type header. |
String |
getContentMediaType()
Gets the response body's media type from the Content-Type header. |
int |
getStatusCode()
Gets the HTTP status code. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ClientResponse(int statusCode,
Map<String,String[]> headers,
InputStream bodyInputStream)
statusCode - The HTTP status codeheaders - The HTTP response headersbodyInputStream - The HTTP response body input stream| Method Detail |
|---|
public int getStatusCode()
public InputStream getBodyInputStream()
public String getBodyContent()
public Object getBodyObject(Consumer consumer,
Class<?> clazz)
throws ControllerException
consumer - The consumerclazz - The class
ControllerException - if the deserialization failspublic String getContentMediaType()
public String getContentCharset()
public String getAuthorizationUser()
public String getAuthorizationPassword()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||