com.atlassian.jira.mail.util
Interface MailAttachmentsManager

All Known Implementing Classes:
MailAttachmentsManagerImpl

public interface MailAttachmentsManager


Field Summary
static String CID_PREFIX
          Content-ID for generated attachments.
 
Method Summary
 Iterable<javax.mail.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(ApplicationUser user)
          Returns a link to access user avatar in email message.
 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 getImageUrl(String path)
          Tries to add image specified by path to email attachments.
 

Field Detail

CID_PREFIX

static final String CID_PREFIX
Content-ID for generated attachments.

See Also:
Constant Field Values
Method Detail

getAvatarUrl

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)

Parameters:
username -
Returns:
cid link or Avatar URL

getAvatarUrl

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)

Parameters:
templateUser -
Returns:
cid link or Avatar URL

getAvatarUrl

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)

Parameters:
user -
Returns:
cid link or Avatar URL

getImageUrl

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

Parameters:
path -
Returns:

getAttachmentsCount

int getAttachmentsCount()
Returns the number of attachments added to this manager

Returns:
number of attachments

buildAttachmentsBodyParts

Iterable<javax.mail.BodyPart> buildAttachmentsBodyParts()
Builds bodyPart for each image (including avatars) added to this manager

Returns:
Added attachments as list of BodyParts


Copyright © 2002-2014 Atlassian. All Rights Reserved.