org.ka2ddo.yaac.webserver
Class HttpConnectionThread
java.lang.Object
org.ka2ddo.yaac.webserver.HttpConnectionThread
- All Implemented Interfaces:
- java.lang.Runnable
public final class HttpConnectionThread
- extends java.lang.Object
- implements java.lang.Runnable
This class processes one inbound HTTP connection.
Field Summary |
static java.lang.String |
CRLF
HTTP standard byte sequence for end-of-line. |
Method Summary |
HttpServer |
getServerInstance()
Get the server instance associated with this thread. |
void |
run()
|
void |
sendError(int error,
java.lang.Object... args)
Produce an HTTP error page with the specified HTTP response error code. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CRLF
public static final java.lang.String CRLF
- HTTP standard byte sequence for end-of-line.
- See Also:
- Constant Field Values
HttpConnectionThread
public HttpConnectionThread(java.net.Socket socket,
java.util.Map<java.lang.String,PathHandler> pathToHandlerMap,
HttpServer serverInstance)
throws java.io.IOException
- Throws:
java.io.IOException
run
public void run()
- Specified by:
run
in interface java.lang.Runnable
sendError
public void sendError(int error,
java.lang.Object... args)
- Produce an HTTP error page with the specified HTTP response error code.
- Parameters:
error
- error code (as defined by the HTTP RFC)args
- other text to be printed after the error code number- See Also:
HttpURLConnection
getServerInstance
public HttpServer getServerInstance()
- Get the server instance associated with this thread.
- Returns:
- HttpServer that created this thread instance