HttpServletRequest request, HttpServletResponse response)
throws JGossipException {
HttpSession session = request.getSession();
User user = (User) session.getAttribute(IConst.SESSION.USER_KEY);
ForumDAO dao = ForumDAO.getInstance();
AttachmentInfoForm aiForm = (AttachmentInfoForm) form;
try {
boolean isUserMod = dao.checkMod(Integer.parseInt(aiForm.getFid()),
user);
// check user access rights
getServlet().log("check user access rights ");
if (isUserMod) {
FileDataInfo fInfo = new FileDataInfo();
BeanUtils.copyProperties(fInfo, aiForm);
dao.updateAttachmentInfo(fInfo);
} else {
return (mapping.findForward(IConst.TOKEN.DENIED));
}
} catch (NumberFormatException e) {
throw new SystemException(e);
} catch (SQLException e) {
throw new SystemException(e);
} catch (IllegalAccessException e) {
throw new SystemException(e);
} catch (InvocationTargetException e) {
throw new SystemException(e);
}
StringBuffer forward = new StringBuffer();
forward.append("/ShowMessage.do?fid=");
forward.append(aiForm.getFid());
forward.append("&tid=");
forward.append(aiForm.getTid());
forward.append("&mid=");
forward.append(aiForm.getMid());
return (new ActionForward(forward.toString(), true));
}