Package fi.iki.elonen.router
Class RouterNanoHTTPD
java.lang.Object
fi.iki.elonen.NanoHTTPD
fi.iki.elonen.router.RouterNanoHTTPD
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classGeneral nanolet to inherit from if you provide text or html data, only fixed size responses will be generated.static classstatic classGeneral nanolet to inherit from if you provide stream data, only chucked responses will be generated.static classHandling error 404 - unrecognized urlsstatic classGeneral nanolet to print debug info's as a html page.static classHandling indexstatic classstatic interfacestatic classstatic classstatic classGeneral nanolet to print debug info's as a html page.static classstatic interfacestatic classNested classes/interfaces inherited from class fi.iki.elonen.NanoHTTPD
NanoHTTPD.AsyncRunner, NanoHTTPD.ClientHandler, NanoHTTPD.ContentType, NanoHTTPD.Cookie, NanoHTTPD.CookieHandler, NanoHTTPD.DefaultAsyncRunner, NanoHTTPD.DefaultServerSocketFactory, NanoHTTPD.DefaultTempFile, NanoHTTPD.DefaultTempFileManager, NanoHTTPD.HTTPSession, NanoHTTPD.IHTTPSession, NanoHTTPD.Method, NanoHTTPD.Response, NanoHTTPD.ResponseException, NanoHTTPD.SecureServerSocketFactory, NanoHTTPD.ServerRunnable, NanoHTTPD.ServerSocketFactory, NanoHTTPD.TempFile, NanoHTTPD.TempFileManager, NanoHTTPD.TempFileManagerFactory -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Loggerlogger to log to.private RouterNanoHTTPD.UriRouterFields inherited from class fi.iki.elonen.NanoHTTPD
asyncRunner, MIME_HTML, MIME_PLAINTEXT, MIME_TYPES, SOCKET_READ_TIMEOUT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddefault routings, they are over writable.voidstatic StringnormalizeUri(String value) voidremoveRoute(String url) serve(NanoHTTPD.IHTTPSession session) Override this to customize the server.<T extends RouterNanoHTTPD.UriResponder>
voidsetNotFoundHandler(Class<T> handler) <T extends RouterNanoHTTPD.UriResponder>
voidsetNotImplementedHandler(Class<T> handler) voidsetRoutePrioritizer(RouterNanoHTTPD.IRoutePrioritizer routePrioritizer) Methods inherited from class fi.iki.elonen.NanoHTTPD
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, wasStarted
-
Field Details
-
LOG
logger to log to. -
router
-
-
Constructor Details
-
RouterNanoHTTPD
public RouterNanoHTTPD(int port) -
RouterNanoHTTPD
-
-
Method Details
-
normalizeUri
-
addMappings
public void addMappings()default routings, they are over writable.router.setNotFoundHandler(GeneralHandler.class);
-
addRoute
-
setNotImplementedHandler
-
setNotFoundHandler
-
removeRoute
-
setRoutePrioritizer
-
serve
Description copied from class:NanoHTTPDOverride this to customize the server. (By default, this returns a 404 "Not Found" plain text error response.)
-