public class

MailAttachmentsManagerImpl

extends Object
implements MailAttachmentsManager
java.lang.Object
   ↳ com.atlassian.jira.mail.util.MailAttachmentsManagerImpl

Summary

[Expand]
Inherited Constants
From interface com.atlassian.jira.mail.util.MailAttachmentsManager
Public Constructors
MailAttachmentsManagerImpl(AvatarService avatarService, UserManager userManager, AvatarManager avatarManager, ApplicationProperties applicationProperties)
Public Methods
Iterable<BodyPart> buildAttachmentsBodyParts()
Builds bodyPart for each image (including avatars) added to this manager
int getAttachmentsCount()
Returns the number of attachments added to this manager
String getAvatarUrl(String username)
Returns a link to access user avatar in email message.
String getAvatarUrl(TemplateUser templateUser)
Returns a link to access user avatar in email message.
String getAvatarUrl(ApplicationUser user)
Returns a link to access user avatar in email message.
String getExternalImageUrl(String path)
If the path is a relative url tries to add the image specified as an attachment.
String getImageUrl(String path)
Tries to add image specified by path to email attachments.
Protected Methods
String getAbsoluteUrl(String path)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.mail.util.MailAttachmentsManager

Public Constructors

public MailAttachmentsManagerImpl (AvatarService avatarService, UserManager userManager, AvatarManager avatarManager, ApplicationProperties applicationProperties)

Public Methods

public Iterable<BodyPart> buildAttachmentsBodyParts ()

Builds bodyPart for each image (including avatars) added to this manager

Returns
  • Added attachments as list of BodyParts

public int getAttachmentsCount ()

Returns the number of attachments added to this manager

Returns
  • number of attachments

public String getAvatarUrl (String username)

Returns a link to access user avatar in email message. If avatar can be attached to email, the cid link is returned, otherwise avatar URL is returned and no image is attached. (E.g. If Gravatar is enabled)

Returns
  • cid link or Avatar URL

public String getAvatarUrl (TemplateUser templateUser)

Returns a link to access user avatar in email message. If avatar can be attached to email, the cid link is returned, otherwise avatar URL is returned and no image is attached. (E.g. If Gravatar is enabled)

Returns
  • cid link or Avatar URL

public String getAvatarUrl (ApplicationUser user)

Returns a link to access user avatar in email message. If avatar can be attached to email, the cid link is returned, otherwise avatar URL is returned and no image is attached. (E.g. If Gravatar is enabled)

Returns
  • cid link or Avatar URL

public String getExternalImageUrl (String path)

If the path is a relative url tries to add the image specified as an attachment. Returns a cid link if successful, or unchanged path if not

public String getImageUrl (String path)

Tries to add image specified by path to email attachments. Returns image cid link if succeeds or unchanged path if specified path cannot be added as attachment

Protected Methods

protected String getAbsoluteUrl (String path)