net.sourceforge.jaulp.email
Class EmailAttachments

java.lang.Object
  extended by net.sourceforge.jaulp.email.EmailAttachments

public class EmailAttachments
extends java.lang.Object

This class adds the functionality to add attachments to the EmailMessage.

Author:
Asterios Raptis

Constructor Summary
EmailAttachments(EmailMessage emailMessage)
          Constructor for the EmailAttachments.
 
Method Summary
 void addAttachment(javax.mail.BodyPart part)
          Adds an attachment to the EmailMessage.
 void addAttachment(byte[] content, java.lang.String filename, java.lang.String mimetype)
          Adds the attachment.
 void addAttachment(javax.activation.DataHandler handler, java.lang.String filename)
          Adds the attachment.
 void addAttachment(java.io.File file)
          Adds an attachment to the EmailMessage.
 void addAttachment(java.io.File file, java.lang.String newFilename)
          Adds an attachment to the EmailMessage.
 EmailMessage getEmailMessage()
          Get's the EmailMessage.
 javax.mail.internet.MimeMultipart getMimeMultiPart()
          Gets the MimeMultipart from the EmailAttachments.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmailAttachments

public EmailAttachments(EmailMessage emailMessage)
                 throws javax.mail.MessagingException
Constructor for the EmailAttachments.

Parameters:
emailMessage - The EmailMessage.
Throws:
javax.mail.MessagingException - if an error occurs.
Method Detail

addAttachment

public void addAttachment(javax.mail.BodyPart part)
                   throws javax.mail.MessagingException
Adds an attachment to the EmailMessage.

Parameters:
part - The BodyPart to add to the EmailMessage.
Throws:
javax.mail.MessagingException - if an error occurs.

addAttachment

public void addAttachment(byte[] content,
                          java.lang.String filename,
                          java.lang.String mimetype)
                   throws javax.mail.MessagingException
Adds the attachment.

Parameters:
content - The bytearray with the content.
filename - The new Filename for the attachment.
mimetype - The mimetype.
Throws:
javax.mail.MessagingException - if an error occurs.

addAttachment

public void addAttachment(javax.activation.DataHandler handler,
                          java.lang.String filename)
                   throws javax.mail.MessagingException
Adds the attachment.

Parameters:
handler - The DataHandler for the attachment.
filename - The new Filename for the attachment.
Throws:
javax.mail.MessagingException - if an error occurs.

addAttachment

public void addAttachment(java.io.File file)
                   throws javax.mail.MessagingException
Adds an attachment to the EmailMessage.

Parameters:
file - The file to add to the EmailMessage.
Throws:
javax.mail.MessagingException - if an error occurs.

addAttachment

public void addAttachment(java.io.File file,
                          java.lang.String newFilename)
                   throws javax.mail.MessagingException
Adds an attachment to the EmailMessage.

Parameters:
file - The file to add to the EmailMessage.
newFilename - The new Filename for the attachment.
Throws:
javax.mail.MessagingException - if an error occurs.

getEmailMessage

public EmailMessage getEmailMessage()
Get's the EmailMessage.

Returns:
's the EmailMessage.

getMimeMultiPart

public javax.mail.internet.MimeMultipart getMimeMultiPart()
                                                   throws javax.mail.MessagingException
Gets the MimeMultipart from the EmailAttachments.

Returns:
's the MimeMultipart from the EmailAttachments.
Throws:
javax.mail.MessagingException - if an error occurs.


Copyright © 2010. All Rights Reserved.