public class SimpleHTTPServer extends Object
HttpServer| Constructor and Description |
|---|
SimpleHTTPServer(int port) |
| Modifier and Type | Method and Description |
|---|---|
com.sun.net.httpserver.HttpContext |
createContext(String context,
com.sun.net.httpserver.HttpHandler handler)
Creates a HttpContext.
|
com.sun.net.httpserver.HttpContext |
createContext(String context,
Map<String,String> httpHeaders,
String responsePayload)
Creates a HttpContext.
|
void |
start()
Start the HTTP Server
|
void |
stop()
Stop the HTTP Server
|
com.sun.net.httpserver.HttpServer |
unwrap()
Unwrap underlying HttpServer instance
|
public SimpleHTTPServer(int port)
throws IOException
IOExceptionpublic com.sun.net.httpserver.HttpContext createContext(String context, Map<String,String> httpHeaders, String responsePayload)
HttpServer. This will create handler that respond with provided HTTP headers and HTTP payloadcontext - context pathhttpHeaders - HTTP response headersresponsePayload - HTTP response payloadHttpContextpublic com.sun.net.httpserver.HttpContext createContext(String context, com.sun.net.httpserver.HttpHandler handler)
context - context pathhandler - HttpHandler implementationHttpContextpublic void start()
public void stop()
public com.sun.net.httpserver.HttpServer unwrap()
Copyright © 2018 WSO2. All rights reserved.