|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.silverpeas.mailinglist.service.job.MailProcessor
public class MailProcessor
Field Summary | |
---|---|
static String |
MAIL_HEADER_IN_REPLY_TO
|
static String |
MAIL_HEADER_REFERENCES
|
static int |
SUMMARY_SIZE
|
Constructor Summary | |
---|---|
MailProcessor()
|
Method Summary | |
---|---|
protected static String |
extractContentType(String contentType)
|
protected String |
getFileName(javax.mail.Part part)
|
protected boolean |
isTextPart(javax.mail.Part part)
Analyze the part to check if it is an attachment, a base64 encoded file or some text. |
void |
prepareMessage(javax.mail.internet.MimeMessage mail,
MessageListener mailingList,
MessageEvent event)
Process an email, extracting attachments and constructing a Message. |
void |
processBody(String content,
String contentType,
Message message)
Processes the body (text) part of an email. |
void |
processMailPart(javax.mail.Part part,
Message message)
Processes a part for a multi-part email. |
void |
processMultipart(javax.mail.Multipart multipart,
Message message)
|
String |
replaceSpecialChars(String toParse)
Replaces special chars. |
String |
saveAttachment(javax.mail.Part part,
String componentId,
String messageId)
Saves an attachment as a file, and stores the path in the message. |
void |
setCleaner(HtmlCleaner cleaner)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SUMMARY_SIZE
public static final String MAIL_HEADER_IN_REPLY_TO
public static final String MAIL_HEADER_REFERENCES
Constructor Detail |
---|
public MailProcessor()
Method Detail |
---|
public void setCleaner(HtmlCleaner cleaner)
public void processMailPart(javax.mail.Part part, Message message) throws javax.mail.MessagingException, IOException
part
- the part to be processed.message
- the message corresponding to the email.
javax.mail.MessagingException
IOException
public void processBody(String content, String contentType, Message message) throws IOException, javax.mail.MessagingException
content
- the text content of the email.contentType
- the content type for this text.message
- the message corresponding to this part
IOException
javax.mail.MessagingException
public String replaceSpecialChars(String toParse)
toParse
- the String whose chars are to be replaced.
public String saveAttachment(javax.mail.Part part, String componentId, String messageId) throws IOException, javax.mail.MessagingException
part
- the part corresponding to the attachment.componentId
- the id of the mailing list component.messageId
- the id of the message (email id).
IOException
javax.mail.MessagingException
public void prepareMessage(javax.mail.internet.MimeMessage mail, MessageListener mailingList, MessageEvent event) throws javax.mail.MessagingException, IOException
mail
- the email to be processed.mailingList
- the mailing list it is going to be affected to.event
- the event which will be send at the end of all processing.
javax.mail.MessagingException
IOException
protected static String extractContentType(String contentType)
protected String getFileName(javax.mail.Part part) throws javax.mail.MessagingException
javax.mail.MessagingException
protected boolean isTextPart(javax.mail.Part part) throws javax.mail.MessagingException
part
- the part to be analyzed.
javax.mail.MessagingException
public void processMultipart(javax.mail.Multipart multipart, Message message) throws javax.mail.MessagingException, IOException
javax.mail.MessagingException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |