public class StreamNanoHTTPD extends FileNanoHTTPD
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 |
|---|---|
TeeOutputStream |
dataReciever
The Data reciever.
|
protected URI |
gatewayUri
The Gateway uri.
|
handlers, pool| Constructor and Description |
|---|
StreamNanoHTTPD(int port)
Instantiates a new Stream nano httpd.
|
StreamNanoHTTPD(int port,
String mimeType,
File primaryFile)
Instantiates a new Stream nano httpd.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAsyncHandler(CharSequence path,
String mimeType,
java.util.function.Consumer<OutputStream> logic,
boolean async)
Add async handler.
|
static java.util.function.Function<fi.iki.elonen.NanoHTTPD.IHTTPSession,fi.iki.elonen.NanoHTTPD.Response> |
asyncHandler(ExecutorService pool,
String mimeType,
java.util.function.Consumer<OutputStream> logic,
boolean async)
Async handler function.
|
StreamNanoHTTPD |
init()
Init stream nano httpd.
|
boolean |
isAutobrowse() |
fi.iki.elonen.NanoHTTPD.Response |
serve(fi.iki.elonen.NanoHTTPD.IHTTPSession session) |
StreamNanoHTTPD |
setAutobrowse(boolean autobrowse) |
protected boolean |
useGzipWhenAccepted(fi.iki.elonen.NanoHTTPD.Response r) |
addHandler, addSessionHandler, create, handlercloseAllConnections, 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, wasStarted@Nonnull public final TeeOutputStream dataReciever
public StreamNanoHTTPD(int port,
String mimeType,
File primaryFile)
throws IOException
port - the portmimeType - the mime typeprimaryFile - the fileIOException - the io exceptionpublic StreamNanoHTTPD(int port)
throws IOException
port - the portIOException - the io exception@Nonnull public StreamNanoHTTPD init() throws IOException
FileNanoHTTPDinit in class FileNanoHTTPDIOException - the io exceptionpublic static java.util.function.Function<fi.iki.elonen.NanoHTTPD.IHTTPSession,fi.iki.elonen.NanoHTTPD.Response> asyncHandler(@Nonnull ExecutorService pool, String mimeType, @Nonnull java.util.function.Consumer<OutputStream> logic, boolean async)
pool - the poolmimeType - the mime typelogic - the logicasync - the asyncpublic void addAsyncHandler(CharSequence path, String mimeType, @Nonnull java.util.function.Consumer<OutputStream> logic, boolean async)
path - the pathmimeType - the mime typelogic - the logicasync - the asyncpublic fi.iki.elonen.NanoHTTPD.Response serve(fi.iki.elonen.NanoHTTPD.IHTTPSession session)
serve in class FileNanoHTTPDprotected boolean useGzipWhenAccepted(fi.iki.elonen.NanoHTTPD.Response r)
useGzipWhenAccepted in class fi.iki.elonen.NanoHTTPDpublic boolean isAutobrowse()
public StreamNanoHTTPD setAutobrowse(boolean autobrowse)
Copyright © 2018 SimiaCryptus Software. All rights reserved.