// Path: test/com/fieldexpert/fbapi4j/common/IOUtil.java
// public static String string(File file) throws java.io.IOException {
// 	return string(new FileInputStream(file));
// }


import static com.fieldexpert.fbapi4j.common.IOUtil.string;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URLDecoder;
import java.util.HashMap;
import java.util.Map;
import com.sun.net.httpserver.Headers;
import com.sun.net.httpserver.HttpExchange;
package com.fieldexpert.fbapi4j.http.server;




class ParameterParser {

	Map<String, String> parse(HttpExchange exchange) throws UnsupportedEncodingException, IOException {
		if ("get".equalsIgnoreCase(exchange.getRequestMethod())) {
			URI requestedUri = exchange.getRequestURI();
			return parseQuery(requestedUri.getRawQuery());
		} else if ("post".equalsIgnoreCase(exchange.getRequestMethod())) {
			Headers headers = exchange.getRequestHeaders();
			String contentType = headers.get("Content-Type").get(0);
			if (contentType.startsWith("multipart/form-data")) {
				return parseMultiForm(exchange);
			} else {
// Path: test/com/fieldexpert/fbapi4j/common/IOUtil.java
// public static String string(File file) throws java.io.IOException {
// 	return string(new FileInputStream(file));
// }


// Path: test/com/fieldexpert/fbapi4j/http/server/ParameterParser.java
import static com.fieldexpert.fbapi4j.common.IOUtil.string;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URLDecoder;
import java.util.HashMap;
import java.util.Map;
import com.sun.net.httpserver.Headers;
import com.sun.net.httpserver.HttpExchange;

package com.fieldexpert.fbapi4j.http.server;




class ParameterParser {

	Map<String, String> parse(HttpExchange exchange) throws UnsupportedEncodingException, IOException {
		if ("get".equalsIgnoreCase(exchange.getRequestMethod())) {
			URI requestedUri = exchange.getRequestURI();
			return parseQuery(requestedUri.getRawQuery());
		} else if ("post".equalsIgnoreCase(exchange.getRequestMethod())) {
			Headers headers = exchange.getRequestHeaders();
			String contentType = headers.get("Content-Type").get(0);
			if (contentType.startsWith("multipart/form-data")) {
				return parseMultiForm(exchange);
			} else {
				return parseQuery(string(exchange.getRequestBody()));