cern.jira.emailhandler
Class NonQuotedCommentHandler

java.lang.Object
  extended by com.atlassian.jira.service.util.handler.AbstractMessageHandler
      extended by com.atlassian.jira.service.util.handler.AbstractCommentHandler
          extended by cern.jira.emailhandler.NonQuotedCommentHandler
All Implemented Interfaces:
com.atlassian.jira.service.util.handler.MessageHandler

public class NonQuotedCommentHandler
extends com.atlassian.jira.service.util.handler.AbstractCommentHandler

This handler adds the body of the email as a comment, using the subject to determine which issue to add the comment to.

The difference between this and FullCommentHandler is that this will strip any quoted lines from the email (ie lines that start with > or |).

See Also:
FullCommentHandler

Field Summary
private static org.apache.log4j.Category log
           
private  java.util.Collection messages
           
private static java.lang.String OUTLOOK_QUOTED_FILE
           
 
Fields inherited from class com.atlassian.jira.service.util.handler.AbstractMessageHandler
applicationProperties, bulk, catchEmail, commentManager, CONTENT_TYPE_PKCS7, CONTENT_TYPE_TEXT, createUsers, deleteEmail, issueFactory, KEY_BULK, KEY_CATCHEMAIL, KEY_CREATEUSERS, KEY_NOTIFYUSERS, KEY_REPORTER, notifyUsers, params, reporteruserName
 
Constructor Summary
NonQuotedCommentHandler()
           
 
Method Summary
protected  java.lang.String getEmailBody(javax.mail.Message message)
          Given a message - this handler will add the entire message body as a comment to the first issue referenced in the subject.
private  java.util.Collection getOutlookQuoteSeparators()
           
private  boolean isOutlookQuotedLine(java.lang.String line)
           
private  boolean isQuotedLine(java.lang.String line)
           
private  boolean looksLikeAttribution(java.lang.String line)
           
 java.lang.String stripQuotedLines(java.lang.String body)
          Given an email body, strips quoted lines and the 'attribution' line that most mailers prepend (eg.
 
Methods inherited from class com.atlassian.jira.service.util.handler.AbstractCommentHandler
getEventTypeId, handleMessage
 
Methods inherited from class com.atlassian.jira.service.util.handler.AbstractMessageHandler
addError, addError, addErrorAndReturnFalse, addErrorAndReturnFalse, canHandleMessage, createAttachmentsForMessage, createAttachmentWithPart, createUserForReporter, getAssociatedIssue, getErrorHandler, getFileFromPart, getI18nBean, getPrecedenceHeader, getReporter, init, recordMessageId, setErrorHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final org.apache.log4j.Category log

OUTLOOK_QUOTED_FILE

private static final java.lang.String OUTLOOK_QUOTED_FILE
See Also:
Constant Field Values

messages

private java.util.Collection messages
Constructor Detail

NonQuotedCommentHandler

public NonQuotedCommentHandler()
Method Detail

getEmailBody

protected java.lang.String getEmailBody(javax.mail.Message message)
                                 throws javax.mail.MessagingException
Given a message - this handler will add the entire message body as a comment to the first issue referenced in the subject.

Specified by:
getEmailBody in class com.atlassian.jira.service.util.handler.AbstractCommentHandler
Throws:
javax.mail.MessagingException

stripQuotedLines

public java.lang.String stripQuotedLines(java.lang.String body)
Given an email body, strips quoted lines and the 'attribution' line that most mailers prepend (eg. "On Wed 21 Oct 2004, Joe Bloggs wrote:").


looksLikeAttribution

private boolean looksLikeAttribution(java.lang.String line)

isQuotedLine

private boolean isQuotedLine(java.lang.String line)

isOutlookQuotedLine

private boolean isOutlookQuotedLine(java.lang.String line)

getOutlookQuoteSeparators

private java.util.Collection getOutlookQuoteSeparators()