org.apache.commons.httpclient
Class StatusLine
java.lang.Object
|
+--org.apache.commons.httpclient.StatusLine
- public class StatusLine
- extends 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,v 1.9.2.4 2004/07/19 20:25:02 olegk Exp $
- Author:
- Jeff Dever, Mike Bowler
- See Also:
HttpStatus
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
StatusLine
public StatusLine(String statusLine)
throws HttpException
- Default constructor.
- Parameters:
statusLine
- the status line returned from the HTTP server- Throws:
HttpException
- if the status line is invalid
getStatusCode
public final int getStatusCode()
- Returns:
- the Status-Code
getHttpVersion
public final String getHttpVersion()
- Returns:
- the HTTP-Version
getReasonPhrase
public final String getReasonPhrase()
- Returns:
- the Reason-Phrase
toString
public final String toString()
- Return the status line as it was set by the constructor.
- Overrides:
toString
in class Object
- Returns:
- a string represenation of this object.
startsWithHTTP
public static boolean startsWithHTTP(String s)
- Tests if the string starts with 'HTTP' signature.
- Parameters:
s
- string to test- Returns:
- true if the line starts with 'HTTP'
signature, false otherwise.
Copyright © 2001-2004 Apache Software Foundation. All Rights Reserved.