public class

AvatarPickerHelperImpl

extends Object
implements AvatarPickerHelper
java.lang.Object
   ↳ com.atlassian.jira.avatar.AvatarPickerHelperImpl

Summary

Nested Classes
class AvatarPickerHelperImpl.Result<T>  
class AvatarPickerHelperImpl.TemporaryAvatarBean  
Public Constructors
AvatarPickerHelperImpl(AvatarManager avatarManager, JiraAuthenticationContext authenticationContext, ApplicationProperties properties, VelocityRequestContextFactory requestContextFactory, UserUtil userUtil, UniversalAvatarsService universalAvatarsService)
Public Methods
Result<Avatar> convertTemporaryToReal(String ownerId, Avatar.Type type, Selection selection)
Converts temporary avatar (uploaded) to real avatar
Result<AvatarPickerHelperImpl.TemporaryAvatarBean> cropTemporary(String ownerId, Avatar.Type type, Selection selection)
Crops the temporary avatar (uploaded) using the given selection.
String getTemporaryAvatarUrl()
Gets temporary avatar url
Result<AvatarPickerHelperImpl.TemporaryAvatarBean> upload(InputStream stream, String fileName, String contentType, long size, String ownerId, Avatar.Type type)
Handles upload of temporary avatar
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.avatar.AvatarPickerHelper

Public Constructors

public AvatarPickerHelperImpl (AvatarManager avatarManager, JiraAuthenticationContext authenticationContext, ApplicationProperties properties, VelocityRequestContextFactory requestContextFactory, UserUtil userUtil, UniversalAvatarsService universalAvatarsService)

Public Methods

public Result<Avatar> convertTemporaryToReal (String ownerId, Avatar.Type type, Selection selection)

Converts temporary avatar (uploaded) to real avatar

Parameters
ownerId the id of the owner, matches the type (project id or user key)
type the desired type of the avatar
selection the area of the temporary avatar to crop real avatar to
Returns
  • conversion result and any errors

public Result<AvatarPickerHelperImpl.TemporaryAvatarBean> cropTemporary (String ownerId, Avatar.Type type, Selection selection)

Crops the temporary avatar (uploaded) using the given selection.

Parameters
ownerId the id of the owner, matches the type (project id or user key)
type the desired type of the avatar.
selection the area of the temporary avatar to crop real avatar to
Returns
  • crop result and any errors

public String getTemporaryAvatarUrl ()

Gets temporary avatar url

Returns
  • temporary avatar url

public Result<AvatarPickerHelperImpl.TemporaryAvatarBean> upload (InputStream stream, String fileName, String contentType, long size, String ownerId, Avatar.Type type)

Handles upload of temporary avatar

Parameters
stream upload io stream
fileName name of upload file
contentType image type
size size of avatar
ownerId ownerId the id of the owner, matches the type (project id or user key)
type the desired type of the avatar.
Returns
  • upload result and any errors