public class SimpleWebServer
extends java.lang.Thread
| Modifier and Type | Field and Description |
|---|---|
static java.util.Map<java.lang.String,java.lang.String> |
MIME_TYPES |
static java.lang.String |
VERSION |
| Constructor and Description |
|---|
SimpleWebServer(java.io.File rootDir,
int port)
Starts the webserver
|
| Modifier and Type | Method and Description |
|---|---|
void |
run() |
void |
setRootDir(java.io.File rootDir)
Changes the root directory where the server runs.
|
void |
stopServer()
Stops the webserver
|
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 java.lang.String VERSION
public static final java.util.Map<java.lang.String,java.lang.String> MIME_TYPES
public SimpleWebServer(java.io.File rootDir,
int port)
throws java.io.IOException
rootDir - The root directory where the server should runport - the port to listen atjava.io.IOExceptionpublic void setRootDir(java.io.File rootDir)
rootDir - the new directory.public void stopServer()
public void run()
run in interface java.lang.Runnablerun in class java.lang.Thread