Package org.europa.together.domain
Class Mail
java.lang.Object
org.europa.together.domain.Mail
Compose E-Mail.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddAttachment(String resource) Add an attachment to the attachment list.voidaddAttachmentList(List<String> attachments) Add attachments from a list of Strings (resource path).booleanaddRecipent(String recipient) Add an recipient to the recipient l.The implementation check if the recipient already exist in the list.Also the format of an valid e-mail address will be tested.voidaddRecipientList(List<String> recipients) Add recipients from a List of Strings (E-Mail Address).voidReset the attachment list.voidReset the Recipient List.List<jakarta.activation.FileDataSource> Return the whole list of attachments - FileDataSource.longGet the limitation for the filesize of attachments. 0 = unlimited.Get the content of a message.Get the MimeTYpe of the E-Mail.List<jakarta.mail.internet.InternetAddress> Get the whole list of recipients - InternetAdress.Get the subject of a e-mail.voidsetAttachmentSize(long attachmentSize) Set a limiter to the filesize for attachments.voidsetMessage(String message) Add e-mail content from a String.voidSet the MimeType of a E-Mail to HTML.voidSet the MimeType of an E-Mail to plain text.voidsetSubject(String subject) Add a subject (topic) to the mail.toString()
-
Constructor Details
-
Mail
public Mail()default constructor. -
Mail
Copy constructor.- Parameters:
mail- as Mail
-
-
Method Details
-
addRecipientList
Add recipients from a List of Strings (E-Mail Address).- Parameters:
recipients- as List.- Throws:
jakarta.mail.internet.AddressException- case of error
-
addAttachmentList
Add attachments from a list of Strings (resource path).- Parameters:
attachments- as List
-
getAttachmentList
Return the whole list of attachments - FileDataSource.- Returns:
- attachments as List
-
addAttachment
Add an attachment to the attachment list. The file size of attachments can be limited. To refer an attachment, set the resource e.g.: picture.png- Parameters:
resource- as String- Returns:
- true on success
-
clearAttachments
public void clearAttachments()Reset the attachment list. -
getRecipentList
Get the whole list of recipients - InternetAdress.- Returns:
- recipients as List
-
addRecipent
Add an recipient to the recipient l.The implementation check if the recipient already exist in the list.Also the format of an valid e-mail address will be tested. If an given e-mail address is not valid it will not added to the list.- Parameters:
recipient- as String- Returns:
- true on success
- Throws:
jakarta.mail.internet.AddressException- case of error
-
clearRecipents
public void clearRecipents()Reset the Recipient List. -
setMimeTypeToHTML
public void setMimeTypeToHTML()Set the MimeType of a E-Mail to HTML. -
setMimeTypeToText
public void setMimeTypeToText()Set the MimeType of an E-Mail to plain text. -
getMimeType
Get the MimeTYpe of the E-Mail.- Returns:
- mimeType as String
-
getSubject
Get the subject of a e-mail.- Returns:
- subject as String
-
setSubject
Add a subject (topic) to the mail.- Parameters:
subject- as String
-
getMessage
Get the content of a message.- Returns:
- content as String
-
setMessage
Add e-mail content from a String.- Parameters:
message- as String
-
getAttachmentSize
public long getAttachmentSize()Get the limitation for the filesize of attachments. 0 = unlimited.- Returns:
- attachmentSize as long
-
setAttachmentSize
public void setAttachmentSize(long attachmentSize) Set a limiter to the filesize for attachments. Default = 0, unlimited.- Parameters:
attachmentSize- as long
-
toString
-