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 booleanprivate final booleanprivate final booleanprivate final org.slf4j.Loggerprivate final List<CharSequence> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateMessageMatcher(List<CharSequence> searchContents, boolean isCaseInsensitive, boolean includeHeaders, boolean ignoringMime, List<String> contentTypes, org.slf4j.Logger logger) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()private booleancheckBody(CharBuffer buffer, MimeTokenStream parser) private booleancheckHeader(CharBuffer buffer, MimeTokenStream parser) private charcomputeNextChar(boolean isCaseInsensitive, char read) private CharBuffercreateBuffer(CharSequence searchContent) protected voidbooleanisFoundIn(Reader reader, CharBuffer buffer) private booleanmatchBufferInMailBeingMimeAware(InputStream input, CharBuffer buffer) private booleanmatches(CharBuffer buffer, char next) booleanmessageMatches(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-InputStreamcontaining an email- Returns:
- true if the content exists and the stream contains the content, false otherwise. It takes the mime structure into account.
- Throws:
IOExceptionMimeException
-
matchBufferInMailBeingMimeAware
private boolean matchBufferInMailBeingMimeAware(InputStream input, CharBuffer buffer) throws IOException, MimeException - Throws:
IOExceptionMimeException
-
checkHeader
- Throws:
IOException
-
checkBody
- Throws:
IOException
-
createBuffer
-
handle
- Throws:
IOExceptionMimeException
-
isFoundIn
- Throws:
IOException
-
computeNextChar
private char computeNextChar(boolean isCaseInsensitive, char read) -
matches
-