org.apache.http.message
Class BasicStatusLine
java.lang.Object
org.apache.http.message.BasicStatusLine
- All Implemented Interfaces:
- StatusLine
- public class BasicStatusLine
- extends java.lang.Object
- implements StatusLine
Represents a status line as returned from a HTTP server.
See RFC2616 section 6.1.
This class is immutable and therefore inherently thread safe.
- Since:
- 4.0
- Version:
- $Id: BasicStatusLine.java 505744 2007-02-10 18:58:45Z rolandw $
- Author:
- Jeff Dever, Mike Bowler
- See Also:
HttpStatus
Constructor Summary |
BasicStatusLine(HttpVersion httpVersion,
int statusCode,
java.lang.String reasonPhrase)
Creates a new status line with the given version, status, and reason. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
BasicStatusLine
public BasicStatusLine(HttpVersion httpVersion,
int statusCode,
java.lang.String reasonPhrase)
- Creates a new status line with the given version, status, and reason.
- Parameters:
httpVersion
- the HTTP version of the responsestatusCode
- the status code of the responsereasonPhrase
- the reason phrase to the status code, or
null
parse
public static StatusLine parse(CharArrayBuffer buffer,
int indexFrom,
int indexTo)
throws ProtocolException
- Parses the status line returned from the HTTP server.
- Parameters:
buffer
- the buffer from which to parseindexFrom
- where to start parsing in the bufferindexTo
- where to stop parsing in the buffer
- Throws:
HttpException
- if the status line is invalid
ProtocolException
parse
public static final StatusLine parse(java.lang.String s)
throws ProtocolException
- Throws:
ProtocolException
getStatusCode
public int getStatusCode()
- Specified by:
getStatusCode
in interface StatusLine
- Returns:
- the Status-Code
getHttpVersion
public HttpVersion getHttpVersion()
- Specified by:
getHttpVersion
in interface StatusLine
- Returns:
- the HTTP-Version
getReasonPhrase
public java.lang.String getReasonPhrase()
- Specified by:
getReasonPhrase
in interface StatusLine
- Returns:
- the Reason-Phrase
toString
public java.lang.String toString()
format
public static void format(CharArrayBuffer buffer,
StatusLine statusline)
format
public static java.lang.String format(StatusLine statusline)
Copyright © 2005-2007 Apache Software Foundation. All Rights Reserved.