HtmlEntityEncoder htmlEntityEncoder = new HtmlEntityEncoder();
// Exclude any resource in the /WEB-INF and /META-INF subdirectories
// (the "toUpperCase()" avoids problems on Windows systems)
if (path == null || path.toUpperCase(Locale.ENGLISH).startsWith("/WEB-INF")
|| path.toUpperCase(Locale.ENGLISH).startsWith("/META-INF")) {
res.sendError(HttpServletResponse.SC_NOT_FOUND, htmlEntityEncoder.encode(path));
log("Can't serve file: " + path);
return;
}
URL resource = servletContext.getResource(path);
if (resource == null) {