Class ByteArrayContainerResponseWriter
java.lang.Object
org.exoplatform.services.rest.tools.ByteArrayContainerResponseWriter
- All Implemented Interfaces:
ContainerResponseWriter
Mock object that can be used for any tests.
- Version:
- $Id: $
- Author:
- Andrey Parfonov
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]getBody()voidreset()Clear message body and HTTP headers map.voidwriteBody(GenericContainerResponse response, javax.ws.rs.ext.MessageBodyWriter entityWriter) Write entity body in output stream.voidwriteHeaders(GenericContainerResponse response) Write HTTP status and headers in HTTP response.
-
Constructor Details
-
ByteArrayContainerResponseWriter
public ByteArrayContainerResponseWriter()
-
-
Method Details
-
writeBody
public void writeBody(GenericContainerResponse response, javax.ws.rs.ext.MessageBodyWriter entityWriter) throws IOException Write entity body in output stream.- Specified by:
writeBodyin interfaceContainerResponseWriter- Parameters:
response- container responseentityWriter- SeeMessageBodyWriter- Throws:
IOException- if any i/o error occurs
-
writeHeaders
Write HTTP status and headers in HTTP response.- Specified by:
writeHeadersin interfaceContainerResponseWriter- Parameters:
response- container response- Throws:
IOException- if any i/o error occurs
-
getBody
public byte[] getBody()- Returns:
- message body
-
getHeaders
- Returns:
- HTTP headers
-
reset
public void reset()Clear message body and HTTP headers map.
-