|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Throwable
java.lang.Exception
sk.baka.ambient.commons.ServerHttpException
public final class ServerHttpException
The server-side HTTP exception.
| Field Summary | |
|---|---|
int |
errorCode
The error code. |
| Constructor Summary | |
|---|---|
ServerHttpException(int errorCode)
Creates new exception. |
|
ServerHttpException(int errorCode,
String message)
Creates new exception. |
|
ServerHttpException(int errorCode,
Throwable cause)
Creates new exception. |
|
| Method Summary | |
|---|---|
String |
getResponseLine(byte httpVersion)
Returns the response line, for example "HTTP/1.1 501 Not Implemented". |
static String |
getResponseLine(byte httpVersion,
int errorCode)
Returns the response line, for example "HTTP/1.1 501 Not Implemented". |
static String |
getStatus(int errorCode)
Returns status name for given error code. |
static void |
writeResponse(byte httpVersion,
int errorCode,
String message,
OutputStream out)
Returns the entire response, for example "HTTP/1.1 501 Not Implemented\r\nPUT Not implemented\r\n\r\n". |
void |
writeResponse(byte httpVersion,
OutputStream out)
Returns the response line, for example "HTTP/1.1 501 Not Implemented\r\nPUT Not implemented\r\n\r\n". |
| Methods inherited from class java.lang.Throwable |
|---|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public final int errorCode
| Constructor Detail |
|---|
public ServerHttpException(int errorCode)
errorCode - the error code.
public ServerHttpException(int errorCode,
String message)
errorCode - the error code.message - optional additional error info.
public ServerHttpException(int errorCode,
Throwable cause)
errorCode - the error code.cause - the cause.| Method Detail |
|---|
public static String getStatus(int errorCode)
errorCode - the error code. See error codes list for details.
public void writeResponse(byte httpVersion,
OutputStream out)
throws IOException
httpVersion - the http version, 0 or 1.out - write the response here.
IOException - if i/o error occurs.public String getResponseLine(byte httpVersion)
httpVersion - the http version, 0 or 1.
public static String getResponseLine(byte httpVersion,
int errorCode)
httpVersion - the http version, 0 or 1.errorCode - the HTTP error code.
public static void writeResponse(byte httpVersion,
int errorCode,
String message,
OutputStream out)
throws IOException
httpVersion - the http version, 0 or 1.errorCode - the HTTP error code.message - optional additional error info.out - write the result here.
IOException - if i/o error occurs.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||