Class UiApiStreamResponse

java.lang.Object
com.kingsrook.qqq.middleware.javalin.specs.invoke.UiApiStreamResponse
All Implemented Interfaces:
AutoCloseable

public class UiApiStreamResponse extends Object implements AutoCloseable
A streaming UI API response. Close after consuming the body, including errors.
  • Constructor Details

    • UiApiStreamResponse

      public UiApiStreamResponse(int status, Map<String,List<String>> headers, InputStream inputStream)
      Construct a response owning the supplied body stream.
  • Method Details

    • getStatus

      public int getStatus()
      Getter for status.
    • getHeaders

      public Map<String,List<String>> getHeaders()
      Getter for headers.
    • getHeader

      public String getHeader(String name)
      First header value, matched without regard to case; null when absent.
    • getInputStream

      public InputStream getInputStream()
      Getter for the caller-owned response stream.
    • isSuccess

      public boolean isSuccess()
      Whether the HTTP status is successful.
    • readBodyAsString

      public String readBodyAsString() throws IOException
      Consume the remaining body as UTF-8, useful for error responses.
      Throws:
      IOException
    • close

      public void close() throws IOException
      Release the response stream and its connection resources.
      Specified by:
      close in interface AutoCloseable
      Throws:
      IOException