return;
}
NDC.push("Support");
try {
Context context = Context.getInstance();
// Fetch the name of the archive file to return. getPathInfo() returns
// items with a leading '/', so we want to pull off only the basename.
// WARNING: For security reasons, the PathInfo parameter must never
// be passed directly to a File() or shell command.
String fileName = baseName(req.getPathInfo());
if (fileName == null) {
// Force a redirect to the archive file.
res.sendRedirect(res.encodeRedirectURL(
baseName(req.getServletPath()) + "/" + archiveName));
} else if (fileName.equalsIgnoreCase(archiveName)) {
res.setContentType(ServletUtil.MIMETYPE_ZIP);
ServletOutputStream out = res.getOutputStream();
try {
handleDoGet(context.getCommonDirPath(), out);
} finally {
out.close();
}
} else {
// Force a redirect to the archive file.