Uses of Interface
com.sun.net.httpserver.HttpHandler
Package
Description
Provides a simple high-level Http server API, which can be used to build
embedded HTTP servers.
-
Uses of HttpHandler in com.sun.net.httpserver
Modifier and TypeMethodDescriptionstatic HttpHandler
SimpleFileServer.createFileHandler
(Path rootDirectory) Creates a file handler that serves files from a given directory path (and its subdirectories).abstract HttpHandler
HttpContext.getHandler()
Returns the handler for this context.static HttpHandler
HttpHandlers.handleOrElse
(Predicate<Request> handlerTest, HttpHandler handler, HttpHandler fallbackHandler) Complements a conditionalHttpHandler
with another handler.static HttpHandler
Returns anHttpHandler
that sends a response comprising the givenstatusCode
,headers
, andbody
.Modifier and TypeMethodDescriptionstatic HttpServer
HttpServer.create
(InetSocketAddress addr, int backlog, String path, HttpHandler handler, Filter... filters) Creates anHttpServer
instance with an initial context.static HttpsServer
HttpsServer.create
(InetSocketAddress addr, int backlog, String path, HttpHandler handler, Filter... filters) Creates anHttpsServer
instance with an initial context.abstract HttpContext
HttpServer.createContext
(String path, HttpHandler handler) Creates aHttpContext
.static HttpHandler
HttpHandlers.handleOrElse
(Predicate<Request> handlerTest, HttpHandler handler, HttpHandler fallbackHandler) Complements a conditionalHttpHandler
with another handler.abstract void
HttpContext.setHandler
(HttpHandler handler) Sets the handler for this context, if not already set.ModifierConstructorDescriptionChain
(List<Filter> filters, HttpHandler handler) Creates aChain
instance with given filters and handler.