This repository has been archived by the owner on Sep 12, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/mailbox' of dlab/hive
from pull-request 1362 * refs/heads/feature/mailbox: docs/mailbox: Describe how Mailbox works Mailbox: Ignore duplicated email Mailbox: Ignore auto-replied emails Introduce Mailbox Service user: Implement toString NotifiationMail: Fix ugly footer in reply Property: Introduce Property NotificationMail: Fix incorrect References header NotificationMail: Make message id simple Attachment: Fix error if filename is not given Attachment: Support streamming Attachment: Fix an incorrect error message User: Extract getPreferredLanguage method Diagnostic: Introduce the Diagnostic Reviewed-by: 백기선 <keesun.baik@navercorp.com>
- Loading branch information
Showing
56 changed files
with
3,161 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package mailbox; | ||
|
||
import org.apache.commons.lang3.StringUtils; | ||
|
||
import javax.mail.internet.MimePart; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class Content { | ||
public String body = ""; | ||
public final List<MimePart> attachments = new ArrayList<>(); | ||
public String type; | ||
|
||
public Content() { } | ||
|
||
public Content(MimePart attachment) { | ||
this.attachments.add(attachment); | ||
} | ||
|
||
public Content merge(Content that) { | ||
body += that.body; | ||
if (StringUtils.isEmpty(type)) { | ||
type = that.type; | ||
} | ||
attachments.addAll(that.attachments); | ||
|
||
return this; | ||
} | ||
} |
Oops, something went wrong.