# Uses of Interface
com.sun.net.httpserver.HttpHandler

Packages that use HttpHandler
Package
Description
com.sun.net.httpserver
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

  Methods in com.sun.net.httpserver that return HttpHandler
  Modifier and Type
  Method
  Description
  `static 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 conditional `HttpHandler` with another handler.
  `static HttpHandler`
  HttpHandlers.`of(int statusCode, Headers headers, String body)`
  Returns an `HttpHandler` that sends a response comprising the given `statusCode`, `headers`, and `body`.
  Methods in com.sun.net.httpserver with parameters of type HttpHandler
  Modifier and Type
  Method
  Description
  `static HttpServer`
  HttpServer.`create(InetSocketAddress addr, int backlog, String path, HttpHandler handler, Filter... filters)`
  Creates an `HttpServer` instance with an initial context.
  `static HttpsServer`
  HttpsServer.`create(InetSocketAddress addr, int backlog, String path, HttpHandler handler, Filter... filters)`
  Creates an `HttpsServer` instance with an initial context.
  `abstract HttpContext`
  HttpServer.`createContext(String path, HttpHandler handler)`
  Creates a `HttpContext`.
  `static HttpHandler`
  HttpHandlers.`handleOrElse(Predicate<Request> handlerTest, HttpHandler handler, HttpHandler fallbackHandler)`
  Complements a conditional `HttpHandler` with another handler.
  `abstract void`
  HttpContext.`setHandler(HttpHandler handler)`
  Sets the handler for this context, if not already set.
  Constructors in com.sun.net.httpserver with parameters of type HttpHandler
  Modifier
  Constructor
  Description
  ``
  `Chain(List<Filter> filters, HttpHandler handler)`
  Creates a `Chain` instance with given filters and handler.