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 class
static class
General nanolet to inherit from if you provide text or html data, only fixed size responses will be generated.static class
static class
General nanolet to inherit from if you provide stream data, only chucked responses will be generated.static class
Handling error 404 - unrecognized urlsstatic class
General nanolet to print debug info's as a html page.static class
Handling indexstatic class
static interface
static class
static class
static class
General nanolet to print debug info's as a html page.static class
static interface
static class
Nested 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 Logger
logger to log to.private RouterNanoHTTPD.UriRouter
Fields inherited from class fi.iki.elonen.NanoHTTPD
asyncRunner, MIME_HTML, MIME_PLAINTEXT, MIME_TYPES, SOCKET_READ_TIMEOUT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
default routings, they are over writable.void
static String
normalizeUri
(String value) void
removeRoute
(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) void
setRoutePrioritizer
(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:NanoHTTPD
Override this to customize the server. (By default, this returns a 404 "Not Found" plain text error response.)
-