|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.noderunner.http.StatusLine
public class StatusLine
This is a immutable implementation of the StatusLine
interface.
Field Summary | |
---|---|
static StatusLine |
HTTP11_100
Basic Continue message from an HTTP/1.1 server. |
static StatusLine |
HTTP11_200_OK
Basic OK message from an HTTP/1.1 server. |
static StatusLine |
HTTP11_204
Basic 204 message from an HTTP/1.1 server. |
static StatusLine |
HTTP11_301
Basic 301 message from an HTTP/1.1 server. |
static StatusLine |
HTTP11_404
Basic 404 message from an HTTP/1.1 server. |
Constructor Summary | |
---|---|
StatusLine(HttpVersion version,
int statusCode,
String reasonPhrase)
Constructs this object using Status-Line |
|
StatusLine(int statusCode)
Constructs this object using a status code, HTTP version 1.1, and blank reason. |
|
StatusLine(int statusCode,
String statusReason)
Constructs this object using Status-Line |
|
StatusLine(String line)
Constructs a StatusLineImpl using an unparsed request
line. |
Method Summary | |
---|---|
HttpVersion |
getHttpVersion()
Returns the status' HTTP version. |
String |
getReasonPhrase()
Returns the status reason phrase. |
int |
getStatusCode()
Returns the three-digit status code. |
static StatusLine |
parseStatusLine(String line)
Returns either HTTP11_200_OK or a newly
constructed StatusLine object. |
String |
toString()
Returns this StatusLine as: |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final StatusLine HTTP11_100
public static final StatusLine HTTP11_200_OK
public static final StatusLine HTTP11_204
public static final StatusLine HTTP11_301
public static final StatusLine HTTP11_404
Constructor Detail |
---|
public StatusLine(int statusCode)
statusCode
- must be in the range 0 to 999public StatusLine(HttpVersion version, int statusCode, String reasonPhrase)
Status-Line parts.
- Parameters:
version
- may not be nullstatusCode
- must be in the range 0 to 999reasonPhrase
- may not be null
public StatusLine(String line) throws HttpException
StatusLineImpl
using an unparsed request
line. This string should not end in CRLF
.
HttpException
- if an invalid HTTP Request-Line was used
in initializationpublic StatusLine(int statusCode, String statusReason)
Status-Line parts.
- Parameters:
statusCode
- must be in the range 0 to 999reasonPhrase
- may not be null
Method Detail |
---|
public static StatusLine parseStatusLine(String line) throws HttpException
HTTP11_200_OK
or a newly
constructed StatusLine
object.
HttpException
public HttpVersion getHttpVersion()
public int getStatusCode()
public String getReasonPhrase()
public String toString()
StatusLine
as:
getHttpVersion() + ' ' + getStatusCode() + ' ' + getReasonPhrase()Note: Does not include
CRLF
.
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |