Methods Summary |
---|
public void | addFrom(javax.mail.Address[] addresses)
m_fromAddresses.add(addresses);
|
public void | addHeader(java.lang.String name, java.lang.String value)
m_contentHeaders.put(name, value);
|
public void | addHeaderLine(java.lang.String headerLine)
int separatorIndex = headerLine.indexOf(":");
if (separatorIndex < 0) throw new MessagingException("header line does not conform to standard");
addHeader(headerLine.substring(0,separatorIndex), headerLine.substring(separatorIndex,headerLine.length()));
|
public void | addRecipient(javax.mail.Message$RecipientType recipientType, javax.mail.Address address)
setRecipients(recipientType, new Address[]{address});
|
public void | addRecipients(javax.mail.Message$RecipientType recipientType, javax.mail.Address[] addresses)
getRecipientsList(recipientType).addAll(Arrays.asList(addresses));
|
public void | addRecipients(javax.mail.Message$RecipientType recipientType, java.lang.String recipient)
getRecipientsList(recipientType).add(recipient);
|
protected javax.mail.internet.InternetHeaders | createInternetHeaders(java.io.InputStream inputStream)
return new InternetHeaders();
|
public java.util.Enumeration | getAllHeaderLines()
return Collections.enumeration(getHeadersAsStrings(m_contentHeaders));
|
public java.util.Enumeration | getAllHeaders()
return Collections.enumeration(m_contentHeaders.values());
|
public javax.mail.Address[] | getAllRecipients()
List allRecipients = new ArrayList();
allRecipients.addAll(m_toRecepients);
allRecipients.addAll(m_ccRecepients);
allRecipients.addAll(m_bccRecepients);
return (Address[]) allRecipients.toArray();
|
public java.lang.Object | getContent()
return m_content;
|
public java.lang.String | getContentID()
return getHeader("Content-ID", null);
|
public java.lang.String[] | getContentLanguage()
return m_contentLanguage;
|
public java.lang.String | getContentMD5()
return getHeader("Content-MD5", null);
|
protected java.io.InputStream | getContentStream()
return null; // trivial implementation
|
public java.lang.String | getContentType()
return getHeader("Content-Type", null);
|
public synchronized javax.activation.DataHandler | getDataHandler()
return m_dataHandler;
|
public java.lang.String | getDescription()
return getHeader("Content-Description", null);
|
public java.lang.String | getDisposition()
return getHeader("Content-Disposition", null);
|
public java.lang.String | getEncoding()
return getHeader("Content-Transfer-Encoding", null);
|
public java.lang.String | getFileName()
return m_fileName;
|
public synchronized javax.mail.Flags | getFlags()
return new Flags(m_setFlags);
|
public javax.mail.Folder | getFolder()
return null;
|
public javax.mail.Address[] | getFrom()
return (Address[])m_fromAddresses.toArray();
|
public java.lang.String[] | getHeader(java.lang.String name)
String value = (String) m_contentHeaders.get(name);
if (value == null) return null;
return new String[] {value};
|
public java.lang.String | getHeader(java.lang.String name, java.lang.String delimiter)
String[] header = getHeader(name);
if (header == null || header.length == 0) return null;
return header[0];
|
private java.util.ArrayList | getHeadersAsStrings(java.util.HashMap contentHeaders)
ArrayList headerLines = new ArrayList();
Iterator iterator = contentHeaders.keySet().iterator();
while (iterator.hasNext()) {
String key = (String) iterator.next();
String value = (String) contentHeaders.get(key);
headerLines.add(key + ":" + value);
}
return headerLines;
|
public java.io.InputStream | getInputStream()
return null; // trivial implementation
|
public int | getLineCount()
return -1; // trivial implementation
|
public java.util.Enumeration | getMatchingHeaderLines(java.lang.String[] names)
ArrayList matchingHeaders = new ArrayList();
for (int i = 0; i < names.length; i++) {
String name = names[i];
String value = getHeader(name, null);
if (value == null) continue;
matchingHeaders.add(name + ":" + value);
}
return Collections.enumeration(matchingHeaders);
|
public java.util.Enumeration | getMatchingHeaders(java.lang.String[] names)
ArrayList matchingHeaders = new ArrayList();
for (int i = 0; i < names.length; i++) {
String name = names[i];
String value = getHeader(name, null);
if (value == null) continue;
matchingHeaders.add(value);
}
return Collections.enumeration(matchingHeaders);
|
public java.lang.String | getMessageID()
return "ID-" + m_iMessageNumber; // trivial implementation
|
public int | getMessageNumber()
return m_iMessageNumber;
|
public java.util.Enumeration | getNonMatchingHeaderLines(java.lang.String[] names)
List existingHeaders = names != null ? Arrays.asList(names) : null;
ArrayList nonMatchingHeaders = new ArrayList();
Iterator iterator = m_contentHeaders.keySet().iterator();
while (iterator.hasNext()) {
String name = (String) iterator.next();
if (existingHeaders!=null && existingHeaders.contains(name)) continue;
String value = getHeader(name, null);
if (value == null) continue;
nonMatchingHeaders.add(name + ":" + value);
}
return Collections.enumeration(nonMatchingHeaders);
|
public java.util.Enumeration | getNonMatchingHeaders(java.lang.String[] names)
List existingHeaders = Arrays.asList(names);
ArrayList nonMatchingHeaders = new ArrayList();
Iterator iterator = m_contentHeaders.keySet().iterator();
while (iterator.hasNext()) {
String name = (String) iterator.next();
if (existingHeaders.contains(name)) continue;
String value = getHeader(name, null);
if (value == null) continue;
nonMatchingHeaders.add(value);
}
return Collections.enumeration(nonMatchingHeaders);
|
public java.io.InputStream | getRawInputStream()
return null; // trivial implementation
|
public java.util.Date | getReceivedDate()
return null; // trivial implementation
|
public javax.mail.Address[] | getRecipients(javax.mail.Message$RecipientType recipientType)
return (Address[]) getRecipientsList(recipientType).toArray();
|
private java.util.List | getRecipientsList(javax.mail.Message$RecipientType recipientType)
if (Message.RecipientType.TO.equals(recipientType)) return m_toRecepients;
if (Message.RecipientType.CC.equals(recipientType)) return m_ccRecepients;
if (Message.RecipientType.BCC.equals(recipientType)) return m_bccRecepients;
return null;
|
public javax.mail.Address[] | getReplyTo()
return (Address[]) m_replyToAddresses.toArray();
|
public javax.mail.Address | getSender()
return m_senderAddress;
|
public java.util.Date | getSentDate()
return m_sentDate;
|
public int | getSize()
return -1; // trivial implementation
|
public java.lang.String | getSubject()
return m_subject;
|
public boolean | isExpunged()
return m_bIsExpunged;
|
public boolean | isMimeType(java.lang.String mimeType)
return mimeType.startsWith(getContentType());
|
public synchronized boolean | isSet(javax.mail.Flags$Flag flag)
return m_setFlags.contains(flag);
|
public boolean | match(javax.mail.search.SearchTerm searchTerm)
return m_doMatch;
|
public void | removeHeader(java.lang.String name)
m_contentHeaders.remove(name);
|
public Message | reply(boolean b)
return new MockMimeMessage(this); // trivial implementation
|
public void | saveChanges()
; // trivial implementation
|
public void | setContent(java.lang.Object object, java.lang.String mimeType)
m_content = object; // trivial implementation
|
public void | setContent(javax.mail.Multipart multipart)
m_content = multipart;
|
public void | setContentID(java.lang.String contentID)
setHeader("Content-ID", contentID);
|
public void | setContentLanguage(java.lang.String[] contentLanguage)
m_contentLanguage = contentLanguage;
|
public void | setContentMD5(java.lang.String value)
setHeader("Content-MD5", value);
|
public synchronized void | setDataHandler(javax.activation.DataHandler dataHandler)
m_dataHandler = dataHandler;
|
public void | setDescription(java.lang.String description)
setHeader("Content-Description", description);
|
public void | setDescription(java.lang.String description, java.lang.String charset)
try {
setDescription(new String(description.getBytes(charset)));
} catch (UnsupportedEncodingException e) {
throw new MessagingException("setting description failed", e);
}
|
public void | setDisposition(java.lang.String disposition)
setHeader("Content-Disposition", disposition);
|
protected void | setExpunged(boolean b)
m_bIsExpunged = b;
|
public void | setFileName(java.lang.String fileName)
m_fileName = fileName;
|
public void | setFlag(javax.mail.Flags$Flag flag, boolean set)
if (set) m_setFlags.add(flag);
else m_setFlags.remove(flag);
|
public synchronized void | setFlags(javax.mail.Flags flags, boolean set)
if (set) m_setFlags.add(flags);
else m_setFlags.remove(flags);
|
public void | setFrom(javax.mail.Address address)
m_fromAddresses.clear();
m_fromAddresses.add(address);
|
public void | setFrom()
m_fromAddresses.clear();
m_fromAddresses.add(InternetAddress.getLocalAddress(null));
|
public void | setHeader(java.lang.String name, java.lang.String value)
addHeader(name, value);
|
protected void | setMessageNumber(int i)
m_iMessageNumber = i;
|
public void | setRecipient(javax.mail.Message$RecipientType recipientType, javax.mail.Address address)
setRecipients(recipientType, new Address[]{address});
|
public void | setRecipients(javax.mail.Message$RecipientType recipientType, javax.mail.Address[] addresses)
getRecipientsList(recipientType).addAll(Arrays.asList(addresses));
|
public void | setRecipients(javax.mail.Message$RecipientType recipientType, java.lang.String recipient)
getRecipientsList(recipientType).add(recipient);
|
public void | setReplyTo(javax.mail.Address[] addresses)
m_replyToAddresses.addAll(Arrays.asList(addresses));
|
public void | setSender(javax.mail.Address address)
m_senderAddress = address;
|
public void | setSentDate(java.util.Date date)
m_sentDate = date;
|
public void | setShouldMatch(boolean doMatch)
m_doMatch = doMatch;
|
public void | setSubject(java.lang.String subject)
m_subject = subject;
|
public void | setSubject(java.lang.String subject, java.lang.String charset)
if (subject == null)
{
m_subject = null;
return;
}
try {
m_subject = new String(subject.getBytes(charset));
} catch (UnsupportedEncodingException e) {
throw new MessagingException("setting subject failed", e);
}
|
public void | setText(java.lang.String string)
setContent(string, "text/plain");
|
public void | setText(java.lang.String string, java.lang.String charset)
try {
setContent(new String(string.getBytes(charset)) , "text/plain");
} catch (UnsupportedEncodingException e) {
throw new MessagingException("setting text content failed", e);
}
|
protected void | updateHeaders()
; // trivial implementation
|
public void | writeTo(java.io.OutputStream outputStream)
; // trivial implementation
|
public void | writeTo(java.io.OutputStream outputStream, java.lang.String[] strings)
; // trivial implementation
|