package org.i2bs.facilehttpd;

import java.io.IOException;
import java.io.InputStream;
import java.net.Socket;

public class Request {
  private InputStream input;

  public Request(Socket sock) throws IOException {
    input = sock.getInputStream();
  }

  public void close() throws IOException {
    input.close();
  }
}
@@ -96,159 +96,1139 @@
 ava.
-net.Socket;%0A%0Apublic class Request %7B%0A  private InputStream input;%0A%0A  public Request(Socket sock) throws IOException %7B%0A    input = sock.getInputStream();
+io.InputStreamReader;%0Aimport java.io.BufferedReader;%0Aimport java.net.Socket;%0A// import java.util.ArrayList;%0Aimport java.util.regex.Matcher;%0Aimport java.util.regex.Pattern;%0A%0Apublic class Request %7B%0A  private static final Pattern border = Pattern.compile(%22%5E$%22);%0A  private static final Pattern request = Pattern.compile(%22%5E(.*) (.*) HTTP/(.*)$%22);%0A  private InputStream input;%0A  String method = null;%0A  String path = null;%0A  String version = null;%0A%0A  public Request(Socket sock) throws IOException %7B%0A    input = sock.getInputStream();%0A    // ArrayList%3CString%3E headers = new ArrayList%3CString%3E();%0A    BufferedReader reader = new BufferedReader(new InputStreamReader(input));%0A%0A    String inline = reader.readLine();%0A    while (reader.ready() && inline != null) %7B%0A      Matcher bm = border.matcher(inline);%0A      if (bm.matches()) break;%0A%0A      if (method == null) %7B%0A        Matcher rm = request.matcher(inline);%0A        if (rm.matches()) %7B%0A          method = rm.group(1);%0A          path = rm.group(2);%0A          version = rm.group(3);%0A          break;%0A        %7D%0A      %7D%0A%0A      // headers.add(inline);%0A      inline = reader.readLine();%0A    %7D
 %0A  %7D

edit Request