@Test public void testWithEtag() throws ServletException, IOException { final HashMap<String, String> headers = new HashMap<>(); headers.put("If-None-Match", StaticResourceServlet.getEtag(new File( rootDirectory, "default.css"))); final HttpServletResponse response = doGetTest("default.css", headers); Mockito.verify(response).setStatus(HttpServletResponse.SC_NOT_MODIFIED); }
static String getEtag(final File resource) { return "W/\"" + resource.length() + "-" + resource.lastModified(); }
StaticResourceServlet extends HttpServlet { static String getEtag(final File resource) { return "W/\"" + resource.length() + "-" + resource.lastModified(); } }
StaticResourceServlet extends HttpServlet { static String getEtag(final File resource) { return "W/\"" + resource.length() + "-" + resource.lastModified(); }  }
StaticResourceServlet extends HttpServlet { static String getEtag(final File resource) { return "W/\"" + resource.length() + "-" + resource.lastModified(); }   }
StaticResourceServlet extends HttpServlet { static String getEtag(final File resource) { return "W/\"" + resource.length() + "-" + resource.lastModified(); }    }