1
2
3
4
5 package example.struts;
6
7 import org.apache.struts.action.*;
8
9 import example.filestorage.*;
10
11 import javax.servlet.http.*;
12
13 /***
14 *
15 * @author Sean C. Sullivan
16 *
17 */
18 public class FileDeleteAction extends Action
19 {
20 public ActionForward execute(ActionMapping mapping,
21 ActionForm form,
22 HttpServletRequest request,
23 HttpServletResponse response) throws Exception
24 {
25 FileDeleteForm deleteForm = (FileDeleteForm) form;
26 long id = Long.parseLong(deleteForm.getFileId());
27
28 FileStorageDAO dao = DAOFactory.getFileStorageDAO();
29 dao.deleteFile(id);
30
31 return mapping.findForward(Forward.KEY_SUCCESS);
32 }
33
34 }