public class StreamNanoHTTPD extends FileNanoHTTPD
NanoHTTPD.AsyncRunner, NanoHTTPD.ClientHandler, NanoHTTPD.Cookie, NanoHTTPD.CookieHandler, NanoHTTPD.DefaultAsyncRunner, NanoHTTPD.DefaultServerSocketFactory, NanoHTTPD.DefaultTempFile, NanoHTTPD.DefaultTempFileManager, NanoHTTPD.DefaultTempFileManagerFactory, NanoHTTPD.HTTPSession, NanoHTTPD.IHTTPSession, NanoHTTPD.Method, NanoHTTPD.Response, NanoHTTPD.ResponseException, NanoHTTPD.SecureServerSocketFactory, NanoHTTPD.ServerRunnable, NanoHTTPD.ServerSocketFactory, NanoHTTPD.TempFile, NanoHTTPD.TempFileManager, NanoHTTPD.TempFileManagerFactory| Modifier and Type | Field and Description |
|---|---|
TeeOutputStream |
dataReciever
The Data reciever.
|
protected URI |
gatewayUri
The Gateway uri.
|
getHandlers, pool, postHandlersasyncRunner, BOUNDARY_PATTERN, BOUNDARY_REGEX, CHARSET_PATTERN, CHARSET_REGEX, CONTENT_DISPOSITION_ATTRIBUTE_PATTERN, CONTENT_DISPOSITION_ATTRIBUTE_REGEX, CONTENT_DISPOSITION_PATTERN, CONTENT_DISPOSITION_REGEX, CONTENT_TYPE_PATTERN, CONTENT_TYPE_REGEX, hostname, LOG, MIME_HTML, MIME_PLAINTEXT, MIME_TYPES, myPort, myServerSocket, myThread, QUERY_STRING_PARAMETER, serverSocketFactory, SOCKET_READ_TIMEOUT, tempFileManagerFactory| 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 |
|---|---|
Closeable |
addAsyncHandler(CharSequence path,
String mimeType,
Consumer<OutputStream> logic,
boolean async)
Add async handler.
|
static Function<NanoHTTPD.IHTTPSession,NanoHTTPD.Response> |
asyncHandler(ExecutorService pool,
String mimeType,
Consumer<OutputStream> logic,
boolean async)
Async handler function.
|
StreamNanoHTTPD |
init()
Init stream nano httpd.
|
boolean |
isAutobrowse()
Is autobrowse boolean.
|
NanoHTTPD.Response |
serve(NanoHTTPD.IHTTPSession session) |
StreamNanoHTTPD |
setAutobrowse(boolean autobrowse)
Sets autobrowse.
|
protected boolean |
useGzipWhenAccepted(NanoHTTPD.Response r) |
addGET, addGET, addPOST, create, handlercloseAllConnections, createClientHandler, createServerRunnable, decodeParameters, decodeParameters, decodePercent, getHostname, getListeningPort, getMimeTypeForFile, getServerSocketFactory, getTempFileManagerFactory, isAlive, loadMimeTypes, makeSecure, makeSSLSocketFactory, makeSSLSocketFactory, makeSSLSocketFactory, mimeTypes, newChunkedResponse, newFixedLengthResponse, newFixedLengthResponse, newFixedLengthResponse, safeClose, 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 exceptionpublic static Function<NanoHTTPD.IHTTPSession,NanoHTTPD.Response> asyncHandler(@Nonnull ExecutorService pool, String mimeType, @Nonnull Consumer<OutputStream> logic, boolean async)
pool - the poolmimeType - the mime typelogic - the logicasync - the async@Nonnull public StreamNanoHTTPD init() throws IOException
FileNanoHTTPDinit in class FileNanoHTTPDIOException - the io exceptionpublic Closeable addAsyncHandler(CharSequence path, String mimeType, @Nonnull Consumer<OutputStream> logic, boolean async)
path - the pathmimeType - the mime typelogic - the logicasync - the asyncpublic NanoHTTPD.Response serve(NanoHTTPD.IHTTPSession session)
serve in class FileNanoHTTPDprotected boolean useGzipWhenAccepted(NanoHTTPD.Response r)
useGzipWhenAccepted in class NanoHTTPDpublic boolean isAutobrowse()
public StreamNanoHTTPD setAutobrowse(boolean autobrowse)
autobrowse - the autobrowseCopyright © 2019 SimiaCryptus Software. All rights reserved.