HttpResponse nettyResponse = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.valueOf(response.status));
if (exposePlayServer) {
nettyResponse.setHeader(SERVER, signature);
}
try {
VirtualFile file = Play.getVirtualFile(renderStatic.file);
if (file != null && file.exists() && file.isDirectory()) {
file = file.child("index.html");
if (file != null) {
renderStatic.file = file.relativePath();
}
}
if ((file == null || !file.exists())) {
serve404(new NotFound("The file " + renderStatic.file + " does not exist"), ctx, request, nettyRequest);
} else {
boolean raw = Play.pluginCollection.serveStatic(file, request, response);
if (raw) {
copyResponse(ctx, request, response, nettyRequest);
} else {
final File localFile = file.getRealFile();
final boolean keepAlive = isKeepAlive(nettyRequest);
nettyResponse = addEtag(nettyRequest, nettyResponse, localFile);
if (nettyResponse.getStatus().equals(HttpResponseStatus.NOT_MODIFIED)) {
Channel ch = e.getChannel();