public class HttpSession extends SessionTask
| Modifier and Type | Class and Description |
|---|---|
static interface |
HttpSession.StringRouter |
static class |
HttpSession.StringSession |
Task.Fork, Task.Invoke<TT>, Task.Spawn<TT>endpointdone, exitResult, fiber, id, pauseReason, running, scheduler, timer| Constructor and Description |
|---|
HttpSession() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
check(HttpResponse resp,
java.io.File file,
java.lang.String... bases) |
void |
problem(HttpResponse resp,
byte[] statusCode,
java.lang.String htmlMsg)
Send an error page to the client.
|
HttpRequest |
readRequest(HttpRequest req)
Reads the socket, parses the HTTP headers and the body (including chunks) into the req object.
|
int |
sendFile(HttpRequest req,
HttpResponse resp,
java.io.File file,
java.lang.String contentType)
send a file with content length to the client
|
void |
sendResponse(HttpResponse resp)
Send the response object in its entirety, and mark it for reuse.
|
closecheckKill, dump, equals, errNotWoven, errNotWoven, errorExit, errorExit, execute, execute, exit, exit, fork, getCurrentTask, getExecutionThread, getPauseReason, getScheduler, getStackDepth, getState, getTid, hashCode, id, idledown, informOnExit, invoke, isDone, join, joinb, onEvent, pause, pause, pinToThread, prePin, resume, resumeOnScheduler, run, setPauseReason, setScheduler, setTid, shutdown, sleep, spawn, spawn, start, toString, unpinFromThread, yield, yieldpublic HttpRequest readRequest(HttpRequest req) throws java.io.IOException, Pausable
req - . The HttpRequest object is reset before filling it in.java.io.IOExceptionPausablepublic void sendResponse(HttpResponse resp) throws java.io.IOException, Pausable
java.io.IOExceptionPausablepublic void problem(HttpResponse resp, byte[] statusCode, java.lang.String htmlMsg) throws java.io.IOException, Pausable
resp - The response object.statusCode - See HttpResponse.ST*htmlMsg - The body of the message that gives more detail.java.io.IOExceptionPausablepublic int sendFile(HttpRequest req, HttpResponse resp, java.io.File file, java.lang.String contentType) throws Pausable
req - the requestresp - the responsefile - the file to sendcontentType - if non-null, set the content typePausablepublic boolean check(HttpResponse resp, java.io.File file, java.lang.String... bases) throws java.io.IOException, Pausable
java.io.IOExceptionPausable