org.apache.jsieve.mail
Class MailUtils

java.lang.Object
  extended by org.apache.jsieve.mail.MailUtils

public class MailUtils
extends java.lang.Object

Class MailUtils implements utility methods that are useful when processing Sieve mail.


Constructor Summary
protected MailUtils()
          Constructor for MailUtils.
 
Method Summary
static java.util.List<java.lang.String> getMatchingHeader(MailAdapter mail, java.lang.String name)
           Method getMatchingHeader answers a List of all of the headers in the mail with the passed name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MailUtils

protected MailUtils()
Constructor for MailUtils.

Method Detail

getMatchingHeader

public static java.util.List<java.lang.String> getMatchingHeader(MailAdapter mail,
                                                                 java.lang.String name)
                                                          throws SieveMailException

Method getMatchingHeader answers a List of all of the headers in the mail with the passed name. If no headers are found an empty List is returned.

This method differs from MailAdapter.getHeader(String) in that it ignores case and whitespace prefixes and suffixes to a header name when performing the match, as required by RFC 3028. Thus "From", "from ", " From" and " from " are considered equal.

Parameters:
name -
Returns:
List
Throws:
SieveMailException


Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.