public class HttpFileServer extends HttpSession
HttpSession.StringRouter, HttpSession.StringSessionTask.Fork, Task.Invoke<TT>, Task.Spawn<TT>| Modifier and Type | Field and Description |
|---|---|
static java.io.File |
baseDirectory |
static java.lang.String |
baseDirectoryName |
static java.util.HashMap<java.lang.String,java.lang.String> |
mimeTypes |
endpointdone, exitResult, fiber, id, pauseReason, running, scheduler, timer| Constructor and Description |
|---|
HttpFileServer() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
check(HttpResponse resp,
java.io.File file) |
void |
execute() |
static void |
main(java.lang.String[] args) |
static java.lang.String |
mimeType(java.io.File file) |
void |
problem(java.io.File file,
HttpResponse resp,
byte[] statusCode,
java.lang.String msg) |
void |
sendDirectory(HttpResponse resp,
java.io.File file,
boolean headOnly) |
void |
sendFile(HttpResponse resp,
java.io.File file,
boolean headOnly) |
static void |
usage() |
check, problem, readRequest, sendFile, sendResponseclosecheckKill, dump, equals, errNotWoven, errNotWoven, errorExit, errorExit, 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 static java.io.File baseDirectory
public static java.lang.String baseDirectoryName
public static java.util.HashMap<java.lang.String,java.lang.String> mimeTypes
public static void main(java.lang.String[] args)
throws java.io.IOException
java.io.IOExceptionpublic static void usage()
public void execute()
throws Pausable,
java.lang.Exception
execute in interface Fiber.Workerexecute in class TaskPausablejava.lang.Exceptionpublic boolean check(HttpResponse resp, java.io.File file) throws java.io.IOException, Pausable
java.io.IOExceptionPausablepublic void sendFile(HttpResponse resp, java.io.File file, boolean headOnly) throws java.io.IOException, Pausable
java.io.IOExceptionPausablepublic void sendDirectory(HttpResponse resp, java.io.File file, boolean headOnly) throws Pausable, java.io.IOException
Pausablejava.io.IOExceptionpublic void problem(java.io.File file,
HttpResponse resp,
byte[] statusCode,
java.lang.String msg)
throws java.io.IOException,
Pausable
java.io.IOExceptionPausablepublic static java.lang.String mimeType(java.io.File file)