This commit is contained in:
milis 2010-11-03 09:10:16 +01:00
parent df197e09c2
commit 7b4a8d8bd0

View file

@ -91,12 +91,25 @@ final class HttpRequest implements Runnable
System.out.println("Request:");
System.out.println(" " + requestLine);
String[] tokens = requestLine.split(" ");
// for(String token : tokens)
// System.out.println("---> " + token);
sendResponse(tokens[1],outs);
// Close streams and sockets
outs.close();
br.close();
socket.close();
}
private void sendResponse(String f,DataOutputStream outs)
throws Exception{
String response = HTTPVERSION+" 200 OK "+CRLF+"kottedala"+CRLF;
outs.writeChars(response);
sendBytes(new FileInputStream(f),outs);
}
private static void sendBytes(FileInputStream fins,
OutputStream outs) throws Exception
{