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
IOException
public static void writeResponse(com.sun.net.httpserver.HttpExchange t, int statusCode, String mimeType, String response) throws IOException
IOException
public static String readRequestBody(com.sun.net.httpserver.HttpExchange t) throws IOException
IOException
public static String readStreamToString(InputStream in) throws IOException
IOException
public static Map<String,List<String>> splitQuery(String query) throws UnsupportedEncodingException
UnsupportedEncodingException
public 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
IOException
Copyright © 2016. All rights reserved.