com.atlassian.jira.mail.util
Class MailAttachmentsManagerImpl

java.lang.Object
  extended by com.atlassian.jira.mail.util.MailAttachmentsManagerImpl
All Implemented Interfaces:
MailAttachmentsManager

public class MailAttachmentsManagerImpl
extends Object
implements MailAttachmentsManager


Field Summary
 
Fields inherited from interface com.atlassian.jira.mail.util.MailAttachmentsManager
CID_PREFIX
 
Constructor Summary
MailAttachmentsManagerImpl(AvatarService avatarService, UserManager userManager, AvatarManager avatarManager, ApplicationProperties applicationProperties)
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MailAttachmentsManagerImpl

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

getAvatarUrl

public String getAvatarUrl(String username)
Description copied from interface: MailAttachmentsManager
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)

Specified by:
getAvatarUrl in interface MailAttachmentsManager
Returns:
cid link or Avatar URL

getAvatarUrl

public String getAvatarUrl(TemplateUser templateUser)
Description copied from interface: MailAttachmentsManager
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)

Specified by:
getAvatarUrl in interface MailAttachmentsManager
Returns:
cid link or Avatar URL

getAvatarUrl

public String getAvatarUrl(ApplicationUser user)
Description copied from interface: MailAttachmentsManager
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)

Specified by:
getAvatarUrl in interface MailAttachmentsManager
Returns:
cid link or Avatar URL

getImageUrl

public String getImageUrl(String path)
Description copied from interface: MailAttachmentsManager
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

Specified by:
getImageUrl in interface MailAttachmentsManager
Returns:

getAttachmentsCount

public int getAttachmentsCount()
Description copied from interface: MailAttachmentsManager
Returns the number of attachments added to this manager

Specified by:
getAttachmentsCount in interface MailAttachmentsManager
Returns:
number of attachments

buildAttachmentsBodyParts

public Iterable<javax.mail.BodyPart> buildAttachmentsBodyParts()
Description copied from interface: MailAttachmentsManager
Builds bodyPart for each image (including avatars) added to this manager

Specified by:
buildAttachmentsBodyParts in interface MailAttachmentsManager
Returns:
Added attachments as list of BodyParts


Copyright © 2002-2014 Atlassian. All Rights Reserved.