* @param request the HttpServletRequest instance
* @param response the HttpServletResponse instance
* @return the name of the next view
*/
public View process(HttpServletRequest request, HttpServletResponse response) throws ServletException {
Blog blog = (Blog)getModel().get(Constants.BLOG_KEY);
String type = request.getParameter("type");
String path = request.getParameter("path");
// if there is no path, we're looking at the root
if (path == null || path.length() == 0) {
path = "/";
}
try {
String filename;
if (type.equals(FileMetaData.BLOG_DATA)) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
if (path.equals("/logs")) {
filename = blog.getId() + "-logs-" + sdf.format(blog.getCalendar().getTime()) + ".zip";
} else {
filename = blog.getId() + "-" + sdf.format(blog.getCalendar().getTime()) + ".zip";
}
} else {
filename = "export.zip";
}