public class HttpExchangeTools extends Object
| Constructor and Description |
|---|
HttpExchangeTools() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addHeader(com.sun.net.httpserver.HttpExchange t,
String name,
String value) |
static void |
dump(com.sun.net.httpserver.HttpExchange t) |
static String |
extractFirstParam(Map<String,List<String>> paramsMap,
String key) |
static String |
paramsMapToString(Map<String,List<String>> paramsMap) |
static String |
readRequestBody(com.sun.net.httpserver.HttpExchange t) |
static String |
readStreamToString(InputStream in) |
static Map<String,List<String>> |
splitQuery(String query) |
static void |
writeResponse(com.sun.net.httpserver.HttpExchange t,
int statusCode,
String mimeType,
String response) |
static void |
writeResponse(com.sun.net.httpserver.HttpExchange t,
String mimeType,
String response) |
public static void writeResponse(com.sun.net.httpserver.HttpExchange t,
String mimeType,
String response)
throws IOException
IOExceptionpublic static void writeResponse(com.sun.net.httpserver.HttpExchange t,
int statusCode,
String mimeType,
String response)
throws IOException
IOExceptionpublic static String readRequestBody(com.sun.net.httpserver.HttpExchange t) throws IOException
IOExceptionpublic static String readStreamToString(InputStream in) throws IOException
IOExceptionpublic static Map<String,List<String>> splitQuery(String query) throws UnsupportedEncodingException
UnsupportedEncodingExceptionpublic static String extractFirstParam(Map<String,List<String>> paramsMap, String key)
public static void addHeader(com.sun.net.httpserver.HttpExchange t,
String name,
String value)
public static void dump(com.sun.net.httpserver.HttpExchange t)
throws IOException
IOExceptionCopyright © 2016. All rights reserved.