Package com.adaptris.util.text.mime
Class SelectByHeader
java.lang.Object
com.adaptris.util.text.mime.SelectByHeader
- All Implemented Interfaces:
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionjavax.mail.internet.MimeBodyPart
Select the body part that should form the AdaptrisMessage payload.List<javax.mail.internet.MimeBodyPart>
select
(javax.mail.internet.MimeMultipart in) Select the body part that should form the AdaptrisMessage payload.void
Specify the header name whose value will be examined .void
Set the value of the regular expression that will be used to match against the header value.
-
Constructor Details
-
SelectByHeader
public SelectByHeader() -
SelectByHeader
-
-
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 interfacePartSelector
- 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 interfacePartSelector
- Parameters:
in
- a MimeMultipart- Returns:
- a list of MimeBodyPart that should be the body, empty if no match found.
- Throws:
javax.mail.MessagingException
-
getHeaderName
- Returns:
- the headerName
-
setHeaderName
Specify the header name whose value will be examined .- Parameters:
s
- the headerName to set, e.g. "Content-Type"
-
getHeaderValueRegExp
- Returns:
- the headerValueRegExp
-
setHeaderValueRegExp
Set the value of the regular expression that will be used to match against the header value.- Parameters:
s
- the headerValueRegExp to set
-