| | |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.io.InputStreamReader; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | public static final String HTTP_PUT = "PUT"; |
| | | public static final String HTTP_DELETE = "DELETE"; |
| | | |
| | | public static final String STR_AMP = "&"; |
| | | public static final String STR_EQUAL = "="; |
| | | |
| | | public static final String CONTENT_TYPE = "Content-Type"; |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | public Map<String, String> getQueryMap(String query) { |
| | | String[] params = query.split(STR_AMP); |
| | | Map<String, String> map = new HashMap<String, String>(); |
| | | for (String param : params) { |
| | | String name = param.split(STR_EQUAL)[0]; |
| | | String value = param.split(STR_EQUAL)[1]; |
| | | map.put(name, value); |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | public File tryWelcomeFiles(HttpExchange e, String fName) { |
| | | boolean notFound = true; |
| | | File file = null; |