Class HttpFunctionHttpResponse

java.lang.Object
net.officefloor.server.google.function.wrap.HttpFunctionHttpResponse
All Implemented Interfaces:
com.google.cloud.functions.HttpResponse

public class HttpFunctionHttpResponse extends Object implements com.google.cloud.functions.HttpResponse
HttpFunction HttpResponse.
  • Constructor Details

    • HttpFunctionHttpResponse

      public HttpFunctionHttpResponse(HttpResponse response)
      Instantiate.
      Parameters:
      response - HttpResponse.
  • Method Details

    • flushEntity

      public void flushEntity() throws Exception
      Ensures to flush and send response.
      Throws:
      Exception - If fails to send.
    • setStatusCode

      public void setStatusCode(int code)
      Specified by:
      setStatusCode in interface com.google.cloud.functions.HttpResponse
    • setStatusCode

      public void setStatusCode(int code, String message)
      Specified by:
      setStatusCode in interface com.google.cloud.functions.HttpResponse
    • setContentType

      public void setContentType(String contentType)
      Specified by:
      setContentType in interface com.google.cloud.functions.HttpResponse
    • getContentType

      public Optional<String> getContentType()
      Specified by:
      getContentType in interface com.google.cloud.functions.HttpResponse
    • appendHeader

      public void appendHeader(String header, String value)
      Specified by:
      appendHeader in interface com.google.cloud.functions.HttpResponse
    • getHeaders

      public Map<String,List<String>> getHeaders()
      Specified by:
      getHeaders in interface com.google.cloud.functions.HttpResponse
    • getOutputStream

      public OutputStream getOutputStream() throws IOException
      Specified by:
      getOutputStream in interface com.google.cloud.functions.HttpResponse
      Throws:
      IOException
    • getWriter

      public BufferedWriter getWriter() throws IOException
      Specified by:
      getWriter in interface com.google.cloud.functions.HttpResponse
      Throws:
      IOException