Class MessageMatcher
java.lang.Object
org.apache.james.mime4j.utils.search.MessageMatcher
Searches an email for content.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final boolean
private final boolean
private final boolean
private final org.slf4j.Logger
private final List
<CharSequence> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
MessageMatcher
(List<CharSequence> searchContents, boolean isCaseInsensitive, boolean includeHeaders, boolean ignoringMime, List<String> contentTypes, org.slf4j.Logger logger) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
private boolean
checkBody
(CharBuffer buffer, MimeTokenStream parser) private boolean
checkHeader
(CharBuffer buffer, MimeTokenStream parser) private char
computeNextChar
(boolean isCaseInsensitive, char read) private CharBuffer
createBuffer
(CharSequence searchContent) protected void
boolean
isFoundIn
(Reader reader, CharBuffer buffer) private boolean
matchBufferInMailBeingMimeAware
(InputStream input, CharBuffer buffer) private boolean
matches
(CharBuffer buffer, char next) boolean
messageMatches
(InputStream input) Is searchContents found in the given input?
-
Field Details
-
logger
private final org.slf4j.Logger logger -
searchContents
-
contentTypes
-
isCaseInsensitive
private final boolean isCaseInsensitive -
includeHeaders
private final boolean includeHeaders -
ignoringMime
private final boolean ignoringMime
-
-
Constructor Details
-
MessageMatcher
private MessageMatcher(List<CharSequence> searchContents, boolean isCaseInsensitive, boolean includeHeaders, boolean ignoringMime, List<String> contentTypes, org.slf4j.Logger logger)
-
-
Method Details
-
builder
-
messageMatches
Is searchContents found in the given input?- Parameters:
input
-InputStream
containing an email- Returns:
- true if the content exists and the stream contains the content, false otherwise. It takes the mime structure into account.
- Throws:
IOException
MimeException
-
matchBufferInMailBeingMimeAware
private boolean matchBufferInMailBeingMimeAware(InputStream input, CharBuffer buffer) throws IOException, MimeException - Throws:
IOException
MimeException
-
checkHeader
- Throws:
IOException
-
checkBody
- Throws:
IOException
-
createBuffer
-
handle
- Throws:
IOException
MimeException
-
isFoundIn
- Throws:
IOException
-
computeNextChar
private char computeNextChar(boolean isCaseInsensitive, char read) -
matches
-