@Deprecated public class

Mail

extends SpaceContentEntityObject
java.lang.Object
   ↳ com.atlassian.core.bean.EntityObject
     ↳ com.atlassian.confluence.core.ConfluenceEntityObject
       ↳ com.atlassian.confluence.core.AbstractVersionedEntityObject
         ↳ com.atlassian.confluence.core.AbstractLabelableEntityObject
           ↳ com.atlassian.confluence.core.ContentEntityObject
             ↳ com.atlassian.confluence.core.SpaceContentEntityObject
               ↳ com.atlassian.confluence.mail.Mail

This class is deprecated.
since 4.2. Mail archiving is now managed entirely by the mail archiving plugin.

Class Overview

I used to be a Mail content object, then I took an arrow in the knee.

This object needs to remain in the codebase so long as we continue to support upgrading from versions of Confluence prior to 4.2

Summary

Constants
String CONTENT_TYPE
String DEFAULT_NO_SUBJECT
int MESSAGE_ID_SIZE
int MESSAGE_SUBJECT_SIZE
[Expand]
Inherited Constants
From class com.atlassian.confluence.core.ContentEntityObject
From class com.atlassian.confluence.core.AbstractVersionedEntityObject
Public Constructors
Mail()
Public Methods
String getAttachmentUrlPath(Attachment attachment)
Gets the path relative to Confluence's base URL to view the given attachment in the context of this content (for example, highlighted in the content's list of attachments).
String getAttachmentsUrlPath()
String getBodyAsString()
Overrides super method to remove leading blank lines.
String getCanonicalSubject()
Get the canonical subject of this mail.
Date getCreationDate()
BodyType getDefaultBodyType()
String getDisplayableCanonicalSubject()
Get the displayable version of the mails canonical subject string.
String getDisplayableSubject()
Get the displayable version of the mails subject string.
String getExcerpt()
ConfluenceMailAddress[] getFrom()
List getFromForSearch()
String getInReplyTo()
String getMessageBody()
String getMessageId()
MimeMessage getMimeMessage()
ConfluenceMailAddress[] getRecipients()
List getRecipientsForSearch()
List getReferences()
Date getSentDate()
String getSubject()
Get the mail subject string.
String getTitle()
String getType()
An easy name for the type of this content: makes it easy for things like the #contentLink macro to work out what to draw.
String getUnquotedTextForSummary()
String getUrlPath()
boolean hasSubject()
void loadContent(InputStream in)
void setBodyAsString(String content)
Convenience method that sets the content of this ContentEntityObject.
void setMessageId(String messageId)
void setMimeMessage(MimeMessage message)
[Expand]
Inherited Methods
From class com.atlassian.confluence.core.SpaceContentEntityObject
From class com.atlassian.confluence.core.ContentEntityObject
From class com.atlassian.confluence.core.AbstractLabelableEntityObject
From class com.atlassian.confluence.core.AbstractVersionedEntityObject
From class com.atlassian.confluence.core.ConfluenceEntityObject
From class com.atlassian.core.bean.EntityObject
From class java.lang.Object
From interface com.atlassian.bonnie.Searchable
From interface com.atlassian.confluence.content.Content
From interface com.atlassian.confluence.core.Addressable
From interface com.atlassian.confluence.core.ContentTypeAware
From interface com.atlassian.confluence.core.Versioned
From interface com.atlassian.confluence.labels.EditableLabelable
From interface com.atlassian.confluence.labels.Labelable
From interface com.atlassian.confluence.spaces.Spaced
From interface java.lang.Comparable

Constants

public static final String CONTENT_TYPE

Constant Value: "mail"

public static final String DEFAULT_NO_SUBJECT

Constant Value: "[No Subject]"

public static final int MESSAGE_ID_SIZE

Constant Value: 255 (0x000000ff)

public static final int MESSAGE_SUBJECT_SIZE

Constant Value: 255 (0x000000ff)

Public Constructors

public Mail ()

Public Methods

public String getAttachmentUrlPath (Attachment attachment)

Gets the path relative to Confluence's base URL to view the given attachment in the context of this content (for example, highlighted in the content's list of attachments). Generally you will want to call getUrlPath() instead of this method: if we ever implement view pages for individual attachments, that's the method that will be changed to point to them. The default implementation just returns the view page for this content.

Parameters
attachment one of this content's attachments
Returns
  • the path relative to the base url to view the attachment in the context of this content.

public String getAttachmentsUrlPath ()

public String getBodyAsString ()

Overrides super method to remove leading blank lines.

Returns
  • the String representation of the mail.

public String getCanonicalSubject ()

Get the canonical subject of this mail. The canonical form removes all Re: and Fwd: style prefixes on the email, returning what should be the original emails subject. All emails within a thread will have the same canonical subject.

See Also

public Date getCreationDate ()

public BodyType getDefaultBodyType ()

public String getDisplayableCanonicalSubject ()

Get the displayable version of the mails canonical subject string. That is, if the mail does not have a canonical subject, return the default.

public String getDisplayableSubject ()

Get the displayable version of the mails subject string. If the mail does not have a subject, then this returns the default subject.

public String getExcerpt ()

public ConfluenceMailAddress[] getFrom ()

public List getFromForSearch ()

public String getInReplyTo ()

public String getMessageBody ()

public String getMessageId ()

public MimeMessage getMimeMessage ()

Throws
MessagingException

public ConfluenceMailAddress[] getRecipients ()

public List getRecipientsForSearch ()

public List getReferences ()

public Date getSentDate ()

public String getSubject ()

Get the mail subject string.

public String getTitle ()

public String getType ()

An easy name for the type of this content: makes it easy for things like the #contentLink macro to work out what to draw.

This is a bit of a hack, but it saves heaps of code elsewhere, especially since we tend to get back these objects wrapped in all sorts of Hibernate CGLIB stuff.

public String getUnquotedTextForSummary ()

public String getUrlPath ()

public boolean hasSubject ()

Returns
  • True if this mail item contains a subject string, false otherwise. If we can not determine the presence of the subject in the mime-message, we assume that one does not exist.

public void loadContent (InputStream in)

Throws
IOException

public void setBodyAsString (String content)

Convenience method that sets the content of this ContentEntityObject.

Parameters
content the String representation of the mail.

public void setMessageId (String messageId)

public void setMimeMessage (MimeMessage message)