Class GitHubConnectorResponse

    • Constructor Detail

      • GitHubConnectorResponse

        protected GitHubConnectorResponse​(@Nonnull
                                          GitHubConnectorRequest request,
                                          int statusCode,
                                          @Nonnull
                                          Map<String,​List<String>> headers)
        GitHubConnectorResponse constructor
        Parameters:
        request - the request
        statusCode - the status code
        headers - the headers
    • Method Detail

      • header

        @CheckForNull
        public String header​(String name)
        Gets the value of a header field for this response.
        Parameters:
        name - the name of the header field.
        Returns:
        the value of the header field, or null if the header isn't set.
      • statusCode

        public int statusCode()
        The status code for this response.
        Returns:
        the status code for this response.
      • allHeaders

        @Nonnull
        public Map<String,​List<String>> allHeaders()
        The headers for this response.
        Returns:
        the headers for this response.
      • wrapStream

        protected InputStream wrapStream​(InputStream stream)
                                  throws IOException
        Handles wrapping the body stream if indicated by the "Content-Encoding" header.
        Parameters:
        stream - the stream to possibly wrap
        Returns:
        an input stream potentially wrapped to decode gzip input
        Throws:
        IOException - if an I/O Exception occurs.
      • parseInt

        public final int parseInt​(String name)
                           throws NumberFormatException
        Parse a header value as a signed decimal integer.
        Parameters:
        name - the header field to parse
        Returns:
        integer value of the header field
        Throws:
        NumberFormatException - if the header is missing or does not contain a parsable integer.