public class HttpServer
extends java.lang.Thread
| Modifier and Type | Field and Description |
|---|---|
protected java.io.ByteArrayInputStream |
bais |
static int |
HEADER_SIZE |
protected IoUtils |
ioUtils |
protected java.io.InputStream |
is |
protected java.io.OutputStream |
os |
protected java.io.PushbackInputStream |
pbis |
protected java.io.PrintWriter |
pw |
protected java.io.File |
wwwRoot |
| Constructor and Description |
|---|
HttpServer(java.net.Socket socket,
java.io.File wwwRoot,
java.lang.String version) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
handleGet(HttpRequest request) |
protected void |
handleOther(java.lang.String method,
HttpRequest httpRequest) |
protected void |
handlePostOrPut(HttpRequest request) |
protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
readHeaders(java.io.BufferedReader br) |
void |
run() |
protected void |
sendResponse(HTTP_STATUS status,
MIME mime,
java.io.InputStream is) |
protected void |
sendResponse(HTTP_STATUS status,
MIME mime,
java.lang.String data) |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldpublic static final int HEADER_SIZE
protected java.io.File wwwRoot
protected java.io.InputStream is
protected java.io.PushbackInputStream pbis
protected java.io.ByteArrayInputStream bais
protected java.io.OutputStream os
protected java.io.PrintWriter pw
protected IoUtils ioUtils
public HttpServer(java.net.Socket socket,
java.io.File wwwRoot,
java.lang.String version)
public void run()
run in interface java.lang.Runnablerun in class java.lang.Threadprotected java.util.Map<java.lang.String,java.util.List<java.lang.String>> readHeaders(java.io.BufferedReader br)
throws java.io.IOException
java.io.IOExceptionprotected void handleOther(java.lang.String method,
HttpRequest httpRequest)
protected void handlePostOrPut(HttpRequest request)
protected void handleGet(HttpRequest request) throws java.io.IOException
java.io.IOExceptionprotected void sendResponse(HTTP_STATUS status, MIME mime, java.lang.String data)
protected void sendResponse(HTTP_STATUS status, MIME mime, java.io.InputStream is)