Package com.atlassian.jira.avatar
Interface AvatarPickerHelper
- All Known Implementing Classes:
AvatarPickerHelperImpl
public interface AvatarPickerHelper
A helper interface for uploading and creating custom avatars
The user will upload an image that is then stored in the session. A url and cropping instructions are sent back to the user so they can select part of the image to be the avatar. Those coordinates are sent back to the server and used to convert the temporary image into an avatar.
- Since:
- v5.0
-
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
-
Method Details
-
upload
AvatarPickerHelperImpl.Result<AvatarPickerHelperImpl.TemporaryAvatarBean> upload(InputStream stream, String fileName, String contentType, long size, String ownerId, IconType iconType) Handles upload of temporary avatar- 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
-
upload
AvatarPickerHelperImpl.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 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
-
convertTemporaryToReal
AvatarPickerHelperImpl.Result<Avatar> convertTemporaryToReal(String ownerId, IconType iconType, Selection selection) Converts temporary avatar (uploaded) to real avatar- 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
AvatarPickerHelperImpl.Result<AvatarPickerHelperImpl.TemporaryAvatarBean> cropTemporary(String ownerId, IconType iconType, 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)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
String getTemporaryAvatarUrl()Gets temporary avatar url- Returns:
- temporary avatar url
-