ServletOutputStream out = response.getOutputStream();
String filename = getServletContext().getRealPath(request.getQueryString());
FileInputStream fin = new FileInputStream(filename);
long start = System.currentTimeMillis();
byte data[] = new byte[1024];
int len = 0;
while ((len = fin.read(data)) > 0) {
out.write(data, 0, len);
}
out.flush();
long stop = System.currentTimeMills();
log("took " + (stop - start) + "ms to download " + filename);