org.apache.mina.http.api

## Class DefaultHttpResponse

- java.lang.Object
- - org.apache.mina.http.api.DefaultHttpResponse

- All Implemented Interfaces:
    HttpMessage, HttpResponse

      public class DefaultHttpResponse
      extends Object
      implements HttpResponse

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultHttpResponse(HttpVersion version, HttpStatus status, Map<String,String> headers)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `containsHeader(String name)` Returns `true` if the HTTP header with the specified name exists in this request.
    `String` | `getContentType()` Gets the `Content-Type` header of the message.
    `String` | `getHeader(String name)` Returns the value of the HTTP header with the specified name.
    `Map<String,String>` | `getHeaders()` Returns a read-only `Map` of HTTP headers whose key is a `String` and whose value is a `String` s.
    `HttpVersion` | `getProtocolVersion()` The HTTP version of the message
    `HttpStatus` | `getStatus()` The HTTP status code for the HTTP response (e.g.
    `boolean` | `isKeepAlive()` Returns `true` if this message enables keep-alive connection.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultHttpResponse

          public DefaultHttpResponse(HttpVersion version,
                             HttpStatus status,
                             Map<String,String> headers)

  - ### Method Detail

    - #### getProtocolVersion

          public HttpVersion getProtocolVersion()

      Description copied from interface: `HttpMessage`
      The HTTP version of the message
      Specified by:
        `getProtocolVersion` in interface `HttpMessage`
      Returns:
        HTTP/1.0 or HTTP/1.1

    - #### getContentType

          public String getContentType()

      Description copied from interface: `HttpMessage`
      Gets the `Content-Type` header of the message.
      Specified by:
        `getContentType` in interface `HttpMessage`
      Returns:
        The content type.

    - #### isKeepAlive

          public boolean isKeepAlive()

      Description copied from interface: `HttpMessage`
      Returns `true` if this message enables keep-alive connection.
      Specified by:
        `isKeepAlive` in interface `HttpMessage`

    - #### getHeader

          public String getHeader(String name)

      Description copied from interface: `HttpMessage`
      Returns the value of the HTTP header with the specified name. If more than one header with the given name is associated with this request, one is selected and returned.
      Specified by:
        `getHeader` in interface `HttpMessage`
      Parameters:
        `name` - The name of the desired header
      Returns:
        The header value - or null if no header is found with the specified name

    - #### containsHeader

          public boolean containsHeader(String name)

      Description copied from interface: `HttpMessage`
      Returns `true` if the HTTP header with the specified name exists in this request.
      Specified by:
        `containsHeader` in interface `HttpMessage`

    - #### getHeaders

          public Map<String,String> getHeaders()

      Description copied from interface: `HttpMessage`
      Returns a read-only `Map` of HTTP headers whose key is a `String` and whose value is a `String` s.
      Specified by:
        `getHeaders` in interface `HttpMessage`

    - #### getStatus

          public HttpStatus getStatus()

      Description copied from interface: `HttpResponse`
      The HTTP status code for the HTTP response (e.g. 200 for OK, 404 for not found, etc..)
      Specified by:
        `getStatus` in interface `HttpResponse`
      Returns:
        the status of the HTTP response

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2004-2012 Apache MINA Project. All Rights Reserved.