Class ByteArrayContainerResponseWriter

java.lang.Object
org.exoplatform.services.rest.tools.ByteArrayContainerResponseWriter
All Implemented Interfaces:
ContainerResponseWriter

public class ByteArrayContainerResponseWriter extends Object implements ContainerResponseWriter
Mock object that can be used for any tests.
Version:
$Id: $
Author:
Andrey Parfonov
See Also:
  • 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:
      writeBody in interface ContainerResponseWriter
      Parameters:
      response - container response
      entityWriter - See MessageBodyWriter
      Throws:
      IOException - if any i/o error occurs
    • writeHeaders

      public void writeHeaders(GenericContainerResponse response) throws IOException
      Write HTTP status and headers in HTTP response.
      Specified by:
      writeHeaders in interface ContainerResponseWriter
      Parameters:
      response - container response
      Throws:
      IOException - if any i/o error occurs
    • getBody

      public byte[] getBody()
      Returns:
      message body
    • getHeaders

      public javax.ws.rs.core.MultivaluedMap<String,Object> getHeaders()
      Returns:
      HTTP headers
    • reset

      public void reset()
      Clear message body and HTTP headers map.