buffer.append(new Date(file.lastModified()));
buffer.append("</td></tr>");
}
public void objectReceived(Session session, Object obj) throws Exception {
HttpRequest request = (HttpRequest) obj;
boolean keepAlive = "keep-alive".equalsIgnoreCase(request
.getParam("Connection"));
ByteBuffer content = getContent(request.getRequestURI());
HttpResponse response = new HttpResponse();
response.setVersion(request.getVersion());
if (content == null) {
response.setStatusCode(404);
response.setReasonPhrase("Not Found");
response.setParam("Content-Type", "text/plain");
response.setParam("Content-Length", String
.valueOf(NOT_FOUND.length));
response.setContent(NOT_FOUND);
} else {
response.setStatusCode(200);
response.setReasonPhrase("OK");
response.setParam("Content-Type", mimeMap.getContentTypeFor(request
.getRequestURI()));
response.setParam("Content-Length", String.valueOf(content
.remaining()));
}
response.setParam("Server", "Cindy Http Server");