1 package alt.javax.mail; 2 3 import com.mockobjects.MockObject; 4 5 import javax.mail.MessagingException ; 6 import javax.mail.Address ; 7 import javax.mail.Flags ; 8 import javax.mail.Multipart ; 9 import java.util.Date ; 10 import java.util.Enumeration ; 11 import java.io.InputStream ; 12 import java.io.IOException ; 13 import java.io.OutputStream ; 14 15 public class MessageImpl implements Message { 16 private final javax.mail.Message message; 17 18 public MessageImpl(javax.mail.Message message) { 19 this.message = message; 20 } 21 22 public javax.mail.Message getRealMessage() { 23 return message; 24 } 25 26 public final Address [] getFrom() throws MessagingException { 27 return message.getFrom(); 28 } 29 30 public final void setFrom() throws MessagingException { 31 message.setFrom(); 32 } 33 34 public final void setFrom(Address address) throws MessagingException { 35 message.setFrom(address); 36 } 37 38 public final void addFrom(Address [] addresses) throws MessagingException { 39 message.addFrom(addresses); 40 } 41 42 public final Address [] getRecipients(javax.mail.Message.RecipientType type) throws MessagingException { 43 return message.getRecipients(type); 44 } 45 46 public final void setRecipients(javax.mail.Message.RecipientType type, Address [] addresses) throws MessagingException { 47 message.setRecipients(type, addresses); 48 } 49 50 public final void addRecipients(javax.mail.Message.RecipientType type, Address [] addresses) throws MessagingException { 51 message.addRecipients(type, addresses); 52 } 53 54 public final String getSubject() throws MessagingException { 55 return message.getSubject(); 56 } 57 58 public final void setSubject(String s) throws MessagingException { 59 message.setSubject(s); 60 } 61 62 public final Date getSentDate() throws MessagingException { 63 return message.getSentDate(); 64 } 65 66 public final void setSentDate(Date date) throws MessagingException { 67 message.setSentDate(date); 68 } 69 70 public final Date getReceivedDate() throws MessagingException { 71 return message.getReceivedDate(); 72 } 73 74 public final Flags getFlags() throws MessagingException { 75 return message.getFlags(); 76 } 77 78 public final void setFlags(Flags flags, boolean b) throws MessagingException { 79 message.setFlags(flags, b); 80 } 81 82 public final Message reply(boolean b) throws MessagingException { 83 return new MessageImpl(message.reply(b)); 84 } 85 86 public final void saveChanges() throws MessagingException { 87 message.saveChanges(); 88 } 89 90 public final int getSize() throws MessagingException { 91 return message.getSize(); 92 } 93 94 public final int getLineCount() throws MessagingException { 95 return message.getLineCount(); 96 } 97 98 public final String getContentType() throws MessagingException { 99 return message.getContentType(); 100 } 101 102 public final boolean isMimeType(String s) throws MessagingException { 103 return message.isMimeType(s); 104 } 105 106 public final String getDisposition() throws MessagingException { 107 return message.getDisposition(); 108 } 109 110 public final void setDisposition(String s) throws MessagingException { 111 message.setDisposition(s); 112 } 113 114 public final String getDescription() throws MessagingException { 115 return message.getDescription(); 116 } 117 118 public final void setDescription(String s) throws MessagingException { 119 message.setDescription(s); 120 } 121 122 public final String getFileName() throws MessagingException { 123 return message.getFileName(); 124 } 125 126 public final void setFileName(String s) throws MessagingException { 127 message.setFileName(s); 128 } 129 130 public final InputStream getInputStream() throws IOException , MessagingException { 131 return message.getInputStream(); 132 } 133 134 public final javax.activation.DataHandler getDataHandler() throws MessagingException { 135 return message.getDataHandler(); 136 } 137 138 public final Object getContent() throws IOException , MessagingException { 139 return message.getContent(); 140 } 141 142 public final void setDataHandler(javax.activation.DataHandler handler) throws MessagingException { 143 message.setDataHandler(handler); 144 } 145 146 public final void setContent(Object o, String s) throws MessagingException { 147 message.setContent(o, s); 148 } 149 150 public final void setText(String s) throws MessagingException { 151 message.setText(s); 152 } 153 154 public final void setContent(Multipart multipart) throws MessagingException { 155 message.setContent(multipart); 156 } 157 158 public final void writeTo(OutputStream stream) throws IOException , MessagingException { 159 message.writeTo(stream); 160 } 161 162 public final String [] getHeader(String s) throws MessagingException { 163 return message.getHeader(s); 164 } 165 166 public final void setHeader(String s, String s1) throws MessagingException { 167 message.setHeader(s, s1); 168 } 169 170 public final void addHeader(String s, String s1) throws MessagingException { 171 message.addHeader(s, s1); 172 } 173 174 public final void removeHeader(String s) throws MessagingException { 175 message.removeHeader(s); 176 } 177 178 public final Enumeration getAllHeaders() throws MessagingException { 179 return message.getAllHeaders(); 180 } 181 182 public final Enumeration getMatchingHeaders(String [] strings) throws MessagingException { 183 return message.getAllHeaders(); 184 } 185 186 public final Enumeration getNonMatchingHeaders(String [] strings) throws MessagingException { 187 return message.getNonMatchingHeaders(strings); 188 } 189 } 190 | Popular Tags |