|
||||||||||
| 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,
java.lang.String message)
Creates new exception. |
|
ServerHttpException(int errorCode,
java.lang.Throwable cause)
Creates new exception. |
|
| Method Summary | |
|---|---|
java.lang.String |
getResponseLine(byte httpVersion)
Returns the response line, for example "HTTP/1.1 501 Not Implemented". |
static java.lang.String |
getResponseLine(byte httpVersion,
int errorCode)
Returns the response line, for example "HTTP/1.1 501 Not Implemented". |
static java.lang.String |
getStatus(int errorCode)
Returns status name for given error code. |
static void |
writeResponse(byte httpVersion,
int errorCode,
java.lang.String message,
java.io.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,
java.io.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,
java.lang.String message)
errorCode - the error code.message - optional additional error info.
public ServerHttpException(int errorCode,
java.lang.Throwable cause)
errorCode - the error code.cause - the cause.| Method Detail |
|---|
public static java.lang.String getStatus(int errorCode)
errorCode - the error code. See error codes list for details.
public void writeResponse(byte httpVersion,
java.io.OutputStream out)
throws java.io.IOException
httpVersion - the http version, 0 or 1.out - write the response here.
java.io.IOException - if i/o error occurs.public java.lang.String getResponseLine(byte httpVersion)
httpVersion - the http version, 0 or 1.
public static java.lang.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,
java.lang.String message,
java.io.OutputStream out)
throws java.io.IOException
httpVersion - the http version, 0 or 1.errorCode - the HTTP error code.message - optional additional error info.out - write the result here.
java.io.IOException - if i/o error occurs.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||