001: /*
002: * Copyright 2001-2005 The Apache Software Foundation
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016: package org.apache.commons.mail.mocks;
017:
018: import java.io.IOException;
019: import java.util.List;
020:
021: import javax.mail.MessagingException;
022: import javax.mail.internet.InternetAddress;
023:
024: import org.apache.commons.mail.HtmlEmail;
025:
026: /**
027: * Extension of the HtmlEmail Class
028: * (used to allow testing only)
029: *
030: * @since 1.0
031: * @author <a href="mailto:corey.scott@gmail.com">Corey Scott</a>
032: * @version $Id: MockHtmlEmailConcrete.java 240033 2005-08-25 10:03:05Z henning $
033: */
034: public class MockHtmlEmailConcrete extends HtmlEmail {
035: /**
036: * Retrieve the message content
037: * @return Message Content
038: */
039: public String getMsg() {
040: try {
041: return this .getPrimaryBodyPart().getContent().toString();
042: } catch (IOException ioE) {
043: return null;
044: } catch (MessagingException msgE) {
045: return null;
046: }
047: }
048:
049: /**
050: * Retrieve the text msg
051: * @return Message Content
052: */
053: public String getTextMsg() {
054: return this .text;
055: }
056:
057: /**
058: * Retrieve the html msg
059: * @return Message Content
060: */
061: public String getHtmlMsg() {
062: return this .html;
063: }
064:
065: /**
066: * @return inlineImages
067: */
068: public List getInlineImages() {
069: return inlineImages;
070: }
071:
072: /**
073: * @return fromAddress
074: */
075: public InternetAddress getFromAddress() {
076: return this .fromAddress;
077: }
078:
079: /**
080: * @return toList
081: */
082: public List getToList() {
083: return this .toList;
084: }
085:
086: /**
087: * @return bccList
088: */
089: public List getBccList() {
090: return this .bccList;
091: }
092:
093: /**
094: * @return ccList
095: */
096: public List getCcList() {
097: return this.ccList;
098: }
099:
100: }
|