private void doWork(HttpServletRequest request, HttpServletResponse response)
throws IOException
{
String pathInfo = request.getPathInfo().substring(getResourcePath().length() + 1,
request.getPathInfo().lastIndexOf("."));
ImageWrapper image = GraphicImageStore.instance().remove(pathInfo);
if (image != null && image.getImage() != null)
{
response.setContentType(image.getContentType().getMimeType());
response.setStatus(HttpServletResponse.SC_OK);
response.setContentLength(image.getImage().length);
ServletOutputStream os = response.getOutputStream();
os.write(image.getImage());
os.flush();
}
else
{
response.sendError(HttpServletResponse.SC_NOT_FOUND);