Package com.atlassian.jira.avatar
Class AvatarPickerHelperImpl
java.lang.Object
com.atlassian.jira.avatar.AvatarPickerHelperImpl
- All Implemented Interfaces:
AvatarPickerHelper
- Since:
- v5.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Constructor Summary
ConstructorsConstructorDescriptionAvatarPickerHelperImpl(AvatarManager avatarManager, JiraAuthenticationContext authenticationContext, ApplicationProperties properties, VelocityRequestContextFactory requestContextFactory, JiraContactHelper jiraContactHelper) -
Method Summary
Modifier and TypeMethodDescriptionconvertTemporaryToReal(String ownerId, IconType iconType, Selection selection) Converts temporary avatar (uploaded) to real avatarcropTemporary(String ownerId, IconType iconType, Selection selection) Crops the temporary avatar (uploaded) using the given selection.Gets temporary avatar urlupload(InputStream stream, String fileName, String contentType, long size, String ownerId, Avatar.Type type) Handles upload of temporary avatarupload(InputStream stream, String fileName, String contentType, long size, String ownerId, IconType iconType) Handles upload of temporary avatar
-
Constructor Details
-
AvatarPickerHelperImpl
public AvatarPickerHelperImpl(AvatarManager avatarManager, JiraAuthenticationContext authenticationContext, ApplicationProperties properties, VelocityRequestContextFactory requestContextFactory, JiraContactHelper jiraContactHelper)
-
-
Method Details
-
upload
public AvatarPickerHelperImpl.Result<AvatarPickerHelperImpl.TemporaryAvatarBean> upload(InputStream stream, String fileName, String contentType, long size, String ownerId, Avatar.Type type) Description copied from interface:AvatarPickerHelperHandles upload of temporary avatar- Specified by:
uploadin interfaceAvatarPickerHelper- Parameters:
stream- upload io streamfileName- name of upload filecontentType- image typesize- size of avatarownerId- 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
-
upload
public AvatarPickerHelperImpl.Result<AvatarPickerHelperImpl.TemporaryAvatarBean> upload(InputStream stream, String fileName, String contentType, long size, String ownerId, IconType iconType) Description copied from interface:AvatarPickerHelperHandles upload of temporary avatar- Specified by:
uploadin interfaceAvatarPickerHelper- Parameters:
stream- upload io streamfileName- name of upload filecontentType- image typesize- size of avatarownerId- ownerId the id of the owner, matches the type (project id or user key)iconType- the desired type of the avatar.- Returns:
- upload result and any errors
-
convertTemporaryToReal
public AvatarPickerHelperImpl.Result<Avatar> convertTemporaryToReal(String ownerId, IconType iconType, Selection selection) Description copied from interface:AvatarPickerHelperConverts temporary avatar (uploaded) to real avatar- Specified by:
convertTemporaryToRealin interfaceAvatarPickerHelper- Parameters:
ownerId- the id of the owner, matches the type (project id or user key)iconType- the desired type of the avatarselection- the area of the temporary avatar to crop real avatar to- Returns:
- conversion result and any errors
-
cropTemporary
public AvatarPickerHelperImpl.Result<AvatarPickerHelperImpl.TemporaryAvatarBean> cropTemporary(String ownerId, IconType iconType, Selection selection) Description copied from interface:AvatarPickerHelperCrops the temporary avatar (uploaded) using the given selection.- Specified by:
cropTemporaryin interfaceAvatarPickerHelper- Parameters:
ownerId- the id of the owner, matches the type (project id or user key)iconType- the desired type of the avatar.selection- the area of the temporary avatar to crop real avatar to- Returns:
- crop result and any errors
-
getTemporaryAvatarUrl
Description copied from interface:AvatarPickerHelperGets temporary avatar url- Specified by:
getTemporaryAvatarUrlin interfaceAvatarPickerHelper- Returns:
- temporary avatar url
-