Class IServerResponseImpl

  • All Implemented Interfaces:
    SimpleResponseWrapper, java.io.Closeable, java.lang.AutoCloseable

    public class IServerResponseImpl
    extends java.lang.Object
    implements SimpleResponseWrapper
    IServer specific Response handling Only predefined headers would be parsed
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      java.lang.String getBody()
      Returns response body as String.
      java.io.InputStream getBodyAsStream()
      Returns response body as Stream.
      java.lang.String getContentType()
      returns content-type header value
      java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getHeaders()
      Returns filtered response headers
      int getStatusCode()
      Returns HTTP response status code
      void setResponse​(okhttp3.Response response)
      populate response
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • IServerResponseImpl

        public IServerResponseImpl()
    • Method Detail

      • getStatusCode

        public int getStatusCode()
        Returns HTTP response status code
        Specified by:
        getStatusCode in interface SimpleResponseWrapper
        Returns:
        response status code
      • getContentType

        public java.lang.String getContentType()
        returns content-type header value
        Specified by:
        getContentType in interface SimpleResponseWrapper
        Returns:
        content-type header value
      • getBody

        public java.lang.String getBody()
                                 throws java.io.IOException
        Returns response body as String. Not multi-thread safe.
        Specified by:
        getBody in interface SimpleResponseWrapper
        Returns:
        response body as String
        Throws:
        java.io.IOException
      • getBodyAsStream

        public java.io.InputStream getBodyAsStream()
        Returns response body as Stream. Not multi-thread safe.
        Specified by:
        getBodyAsStream in interface SimpleResponseWrapper
        Returns:
        response body as Stream
      • getHeaders

        public java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getHeaders()
        Returns filtered response headers
        Specified by:
        getHeaders in interface SimpleResponseWrapper
        Returns:
        Response headers
      • setResponse

        public void setResponse​(okhttp3.Response response)
                         throws java.io.IOException
        populate response
        Specified by:
        setResponse in interface SimpleResponseWrapper
        Throws:
        java.io.IOException
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException