*
* @author
Frank W. Zammetti.
*/
public class MailDeleter {
/**
* Log instance.
*/
private static Log log = LogFactory.getLog(MailDeleter.class);
/**
* This method deletes a message.
*
* @param msgType The type of message to delete, either "sent" or
* "retrieved".
* @param filenames The names of the files the messages are stored on disk
* under if deleting Sent Messages, null otherwise. This
* can be a comma-separated list of file names, or just
* a single value.
CHAPTER 4 n INSTAMAIL: AN AJAX-BASED WEBMAIL CLIENT 184
* @param msgIDs The IDs of the messages if deleting messages in the
* Inbox, null otherwise. This can be a comma-separated
* list of IDs, or just a single value.
* @param sc ServletContext of the incoming request.
* @return A string indicating success or failure.
*/
public String deleteMessages(String msgType, String filenames, String msgIDs,
ServletContext sc) {
log.info("\nAbout to delete message:\n" +
"msgType = " + msgType + "\n" +
"filenames = " + filenames + "\n" +
"msgIDs = " + msgIDs + "\n");
String result = "Message(s) deleted.";
Store store = null;
Folder folder = null;
try {
if (msgType.
Pages:
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345