Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.http
Class StatusLine  view StatusLine download StatusLine.java

java.lang.Object
  extended byorg.apache.http.StatusLine

public class StatusLine
extends java.lang.Object

Represents a Status-Line as returned from a HTTP server. RFC2616 states the following regarding the Status-Line:

 6.1 Status-Line

  The first line of a Response message is the Status-Line, consisting
  of the protocol version followed by a numeric status code and its
  associated textual phrase, with each element separated by SP
  characters. No CR or LF is allowed except in the final CRLF sequence.

      Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF
 

This class is immutable and is inherently thread safe.

Since:
2.0
Version:
$Id: StatusLine.java 376961 2006-02-11 10:32:50Z olegk $

Field Summary
private  HttpVersion httpVersion
          The HTTP-Version.
private  java.lang.String reasonPhrase
          The Reason-Phrase.
private  int statusCode
          The Status-Code.
 
Constructor Summary
StatusLine(HttpVersion httpVersion, int statusCode)
           
StatusLine(HttpVersion httpVersion, int statusCode, java.lang.String reasonPhrase)
          Default constructor
 
Method Summary
static void format(org.apache.http.io.CharArrayBuffer buffer, StatusLine statusline)
           
static java.lang.String format(StatusLine statusline)
           
 HttpVersion getHttpVersion()
           
 java.lang.String getReasonPhrase()
           
 int getStatusCode()
           
static StatusLine parse(org.apache.http.io.CharArrayBuffer buffer, int indexFrom, int indexTo)
          Parses the status line returned from the HTTP server.
static StatusLine parse(java.lang.String s)
           
 java.lang.String toString()
          Convert this Object to a human-readable String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

httpVersion

private final HttpVersion httpVersion
The HTTP-Version.


statusCode

private final int statusCode
The Status-Code.


reasonPhrase

private final java.lang.String reasonPhrase
The Reason-Phrase.

Constructor Detail

StatusLine

public StatusLine(HttpVersion httpVersion,
                  int statusCode,
                  java.lang.String reasonPhrase)
Default constructor


StatusLine

public StatusLine(HttpVersion httpVersion,
                  int statusCode)
Method Detail

parse

public static StatusLine parse(org.apache.http.io.CharArrayBuffer buffer,
                               int indexFrom,
                               int indexTo)
                        throws ProtocolException
Parses the status line returned from the HTTP server.

Since:
4.0

parse

public static final StatusLine parse(java.lang.String s)
                              throws ProtocolException

getStatusCode

public final int getStatusCode()

getHttpVersion

public final HttpVersion getHttpVersion()

getReasonPhrase

public final java.lang.String getReasonPhrase()

toString

public final java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).


format

public static void format(org.apache.http.io.CharArrayBuffer buffer,
                          StatusLine statusline)

format

public static java.lang.String format(StatusLine statusline)