01: package org.claros.mini.actions;
02:
03: import javax.servlet.http.HttpServletRequest;
04: import javax.servlet.http.HttpServletResponse;
05: import org.apache.struts.action.ActionForm;
06: import org.apache.struts.action.ActionForward;
07: import org.apache.struts.action.ActionMapping;
08:
09: import org.claros.commons.mail.models.ConnectionMetaHandler;
10: import org.claros.commons.mail.models.ConnectionProfile;
11: import org.claros.commons.models.AuthProfile;
12: import org.claros.mini.common.BaseLoggedAction;
13: import org.claros.mini.controllers.FolderController;
14: import org.claros.mini.factory.FolderControllerFactory;
15:
16: /**
17: * @version 1.0
18: * @author Umut Gökbayrak
19: */
20: public class EmptyFolderAction extends BaseLoggedAction {
21:
22: public ActionForward myExecute(ActionMapping mapping,
23: ActionForm form, HttpServletRequest request,
24: HttpServletResponse response) throws Exception {
25: String folder = (String) getVariable(request, "folderid");
26: AuthProfile auth = getAuthProfile(request);
27:
28: ConnectionMetaHandler handler = getConnectionHandler(request);
29: ConnectionProfile profile = getConnectionProfile(request);
30:
31: FolderControllerFactory factory = new FolderControllerFactory(
32: auth, profile, handler);
33: FolderController foldCont = factory.getFolderController();
34:
35: foldCont.emptyFolder(folder);
36:
37: return mapping.findForward("success");
38: }
39: }
|