public class FileNanoHTTPD
extends fi.iki.elonen.NanoHTTPD
fi.iki.elonen.NanoHTTPD.AsyncRunner, fi.iki.elonen.NanoHTTPD.ClientHandler, fi.iki.elonen.NanoHTTPD.Cookie, fi.iki.elonen.NanoHTTPD.CookieHandler, fi.iki.elonen.NanoHTTPD.DefaultAsyncRunner, fi.iki.elonen.NanoHTTPD.DefaultServerSocketFactory, fi.iki.elonen.NanoHTTPD.DefaultTempFile, fi.iki.elonen.NanoHTTPD.DefaultTempFileManager, fi.iki.elonen.NanoHTTPD.HTTPSession, fi.iki.elonen.NanoHTTPD.IHTTPSession, fi.iki.elonen.NanoHTTPD.Method, fi.iki.elonen.NanoHTTPD.Response, fi.iki.elonen.NanoHTTPD.ResponseException, fi.iki.elonen.NanoHTTPD.SecureServerSocketFactory, fi.iki.elonen.NanoHTTPD.ServerRunnable, fi.iki.elonen.NanoHTTPD.ServerSocketFactory, fi.iki.elonen.NanoHTTPD.TempFile, fi.iki.elonen.NanoHTTPD.TempFileManager, fi.iki.elonen.NanoHTTPD.TempFileManagerFactory| Modifier and Type | Field and Description |
|---|---|
Map<CharSequence,java.util.function.Function<fi.iki.elonen.NanoHTTPD.IHTTPSession,fi.iki.elonen.NanoHTTPD.Response>> |
handlers
The Custom handlers.
|
protected ExecutorService |
pool
The Pool.
|
| Constructor and Description |
|---|
FileNanoHTTPD(File root,
int port)
Instantiates a new File nano httpd.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addHandler(CharSequence path,
String mimeType,
java.util.function.Consumer<OutputStream> logic)
Add sync handler.
|
java.util.function.Function<fi.iki.elonen.NanoHTTPD.IHTTPSession,fi.iki.elonen.NanoHTTPD.Response> |
addSessionHandler(CharSequence path,
java.util.function.Function<fi.iki.elonen.NanoHTTPD.IHTTPSession,fi.iki.elonen.NanoHTTPD.Response> value)
Add session handler function.
|
static FileNanoHTTPD |
create(int port,
File path,
String mimeType)
Create output stream.
|
static java.util.function.Function<fi.iki.elonen.NanoHTTPD.IHTTPSession,fi.iki.elonen.NanoHTTPD.Response> |
handler(ExecutorService pool,
String mimeType,
java.util.function.Consumer<OutputStream> logic)
Sync handler function.
|
FileNanoHTTPD |
init()
Init stream nano httpd.
|
fi.iki.elonen.NanoHTTPD.Response |
serve(fi.iki.elonen.NanoHTTPD.IHTTPSession session) |
closeAllConnections, createClientHandler, createServerRunnable, decodeParameters, decodeParameters, decodePercent, getHostname, getListeningPort, getMimeTypeForFile, getServerSocketFactory, getTempFileManagerFactory, isAlive, makeSecure, makeSSLSocketFactory, makeSSLSocketFactory, makeSSLSocketFactory, mimeTypes, newChunkedResponse, newFixedLengthResponse, newFixedLengthResponse, newFixedLengthResponse, serve, setAsyncRunner, setServerSocketFactory, setTempFileManagerFactory, start, start, start, stop, useGzipWhenAccepted, wasStartedpublic final Map<CharSequence,java.util.function.Function<fi.iki.elonen.NanoHTTPD.IHTTPSession,fi.iki.elonen.NanoHTTPD.Response>> handlers
protected final ExecutorService pool
public FileNanoHTTPD(File root, int port)
root - the rootport - the port@Nonnull public static FileNanoHTTPD create(int port, @Nonnull File path, String mimeType) throws IOException
port - the portpath - the pathmimeType - the mime typeIOException - the io exceptionpublic static java.util.function.Function<fi.iki.elonen.NanoHTTPD.IHTTPSession,fi.iki.elonen.NanoHTTPD.Response> handler(ExecutorService pool, String mimeType, @Nonnull java.util.function.Consumer<OutputStream> logic)
pool - the poolmimeType - the mime typelogic - the logicpublic java.util.function.Function<fi.iki.elonen.NanoHTTPD.IHTTPSession,fi.iki.elonen.NanoHTTPD.Response> addSessionHandler(CharSequence path, java.util.function.Function<fi.iki.elonen.NanoHTTPD.IHTTPSession,fi.iki.elonen.NanoHTTPD.Response> value)
path - the pathvalue - the valuepublic void addHandler(CharSequence path, String mimeType, @Nonnull java.util.function.Consumer<OutputStream> logic)
path - the pathmimeType - the mime typelogic - the logic@Nonnull public FileNanoHTTPD init() throws IOException
IOException - the io exceptionpublic fi.iki.elonen.NanoHTTPD.Response serve(fi.iki.elonen.NanoHTTPD.IHTTPSession session)
serve in class fi.iki.elonen.NanoHTTPDCopyright © 2018 SimiaCryptus Software. All rights reserved.