01: /*
02: * Created on 21/08/2006 22:00:12
03: */
04: package net.jforum.api.integration.mail.pop;
05:
06: import java.util.ArrayList;
07: import java.util.List;
08:
09: import javax.mail.Message;
10:
11: import org.apache.log4j.Logger;
12:
13: /**
14: * @author Rafael Steil
15: * @version $Id: POPParser.java,v 1.3 2006/10/05 02:00:23 rafaelsteil Exp $
16: */
17: public class POPParser {
18: private static Logger logger = Logger.getLogger(POPParser.class);
19:
20: private List messages = new ArrayList();
21:
22: public void parseMessages(POPConnector connector) {
23: Message[] connectorMessages = connector.listMessages();
24:
25: for (int i = 0; i < connectorMessages.length; i++) {
26: POPMessage message = new POPMessage(connectorMessages[i]);
27: this .messages.add(message);
28:
29: logger.debug("Retrieved message " + message);
30: }
31: }
32:
33: public List getMessages() {
34: return this.messages;
35: }
36: }
|