hje
This commit is contained in:
parent
df197e09c2
commit
7b4a8d8bd0
1 changed files with 72 additions and 59 deletions
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue