Class SelectByHeader

java.lang.Object
com.adaptris.util.text.mime.SelectByHeader
All Implemented Interfaces:
PartSelector

public class SelectByHeader extends Object implements PartSelector
PartSelector implementation that parses a specific header examining the value to see if it matches the configured regular expression.

In the adapter configuration file this class is aliased as mime-select-by-header which is the preferred alternative to the fully qualified classname when building your configuration.

  • Constructor Details

    • SelectByHeader

      public SelectByHeader()
    • SelectByHeader

      public SelectByHeader(String header, String regexp)
  • Method Details

    • select

      public javax.mail.internet.MimeBodyPart select(BodyPartIterator m) throws javax.mail.MessagingException
      Description copied from interface: PartSelector
      Select the body part that should form the AdaptrisMessage payload.
      Specified by:
      select in interface PartSelector
      Returns:
      the MimeBodyPart that should be the body, or null if no match found.
      Throws:
      javax.mail.MessagingException
    • select

      public List<javax.mail.internet.MimeBodyPart> select(javax.mail.internet.MimeMultipart in) throws javax.mail.MessagingException
      Description copied from interface: PartSelector
      Select the body part that should form the AdaptrisMessage payload.
      Specified by:
      select in interface PartSelector
      Parameters:
      in - a MimeMultipart
      Returns:
      a list of MimeBodyPart that should be the body, empty if no match found.
      Throws:
      javax.mail.MessagingException
    • getHeaderName

      public String getHeaderName()
      Returns:
      the headerName
    • setHeaderName

      public void setHeaderName(String s)
      Specify the header name whose value will be examined .
      Parameters:
      s - the headerName to set, e.g. "Content-Type"
    • getHeaderValueRegExp

      public String getHeaderValueRegExp()
      Returns:
      the headerValueRegExp
    • setHeaderValueRegExp

      public void setHeaderValueRegExp(String s)
      Set the value of the regular expression that will be used to match against the header value.
      Parameters:
      s - the headerValueRegExp to set