Initial http-server work.

This commit is contained in:
FrozenCow 2011-02-05 04:33:27 +01:00
parent 711341ec47
commit bf0edea7e2
4 changed files with 163 additions and 40 deletions

View file

@ -0,0 +1,27 @@
package org.dynmap.web;
import java.io.IOException;
import java.io.OutputStream;
import java.util.HashMap;
import java.util.Map;
public class HttpResponse {
public int statusCode = 200;
public String statusMessage = "OK";
public Map<String, String> fields = new HashMap<String, String>();
private OutputStream body;
public OutputStream getBody() throws IOException {
if (body != null) {
WebServerRequest.writeResponseHeader(body, this);
OutputStream b = body;
body = null;
return b;
}
return null;
}
public HttpResponse(OutputStream body) {
this.body = body;
}
}