@Component public class AvatarResourceHelper extends Object
Constructor and Description |
---|
AvatarResourceHelper(JiraAuthenticationContext authContext,
AvatarManager avatarManager,
AvatarPickerHelper avatarPickerHelper,
AttachmentHelper attachmentHelper,
UserManager userManager,
JiraAvatarSupport jiraAvatarSupport) |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
createAvatarFromTemporary(Avatar.Type type,
String ownerId,
AvatarCroppingBean croppingInstructions)
Converts temporary avatar into a real avatar
|
javax.ws.rs.core.Response |
cropTemporaryAvatar(Avatar.Type type,
String ownerId,
AvatarCroppingBean croppingInstructions) |
javax.ws.rs.core.Response |
deleteAvatar(Long id)
Deletes avatar
|
Map<String,List<AvatarBean>> |
getAllAvatars(Avatar.Type type,
String ownerId,
Long selectedAvatarId)
Returns all avatars which are visible for the currently logged in user.
|
javax.ws.rs.core.Response |
getAllSystemAvatars(Avatar.Type type)
Returns all system avatars of the given type.
|
javax.ws.rs.core.Response |
storeTemporaryAvatar(Avatar.Type type,
String ownerId,
String filename,
Long size,
javax.servlet.http.HttpServletRequest request)
Creates temporary avatar and provides instructions for cropping (if needed)
|
javax.ws.rs.core.Response |
storeTemporaryAvatarUsingMultiPart(Avatar.Type type,
String ownerId,
com.atlassian.plugins.rest.common.multipart.FilePart filePart,
javax.servlet.http.HttpServletRequest request)
Creates temporary avatar using multipart.
|
@Inject public AvatarResourceHelper(JiraAuthenticationContext authContext, AvatarManager avatarManager, AvatarPickerHelper avatarPickerHelper, AttachmentHelper attachmentHelper, UserManager userManager, JiraAvatarSupport jiraAvatarSupport)
public Map<String,List<AvatarBean>> getAllAvatars(Avatar.Type type, String ownerId, Long selectedAvatarId)
type
- - Type of avatars (User or Project)ownerId
- - (project id or username)selectedAvatarId
- - id of selected avatarpublic javax.ws.rs.core.Response getAllSystemAvatars(Avatar.Type type)
type
- - Type of avatars (User or Project)public javax.ws.rs.core.Response createAvatarFromTemporary(Avatar.Type type, String ownerId, AvatarCroppingBean croppingInstructions)
type
- - Type of avatars (User or Project)ownerId
- - (project id or username)croppingInstructions
- - Corrdinates to crop imagepublic javax.ws.rs.core.Response storeTemporaryAvatar(Avatar.Type type, String ownerId, String filename, Long size, javax.servlet.http.HttpServletRequest request)
type
- - Type of avatars (User or Project)ownerId
- - (project id or username)filename
- - name of file being uploadedsize
- - size of filerequest
- - servlet requestpublic javax.ws.rs.core.Response storeTemporaryAvatarUsingMultiPart(Avatar.Type type, String ownerId, com.atlassian.plugins.rest.common.multipart.FilePart filePart, javax.servlet.http.HttpServletRequest request)
type
- - Type of avatars (User or Project)ownerId
- - (project id or username)filePart
- - File bodyrequest
- - servlet requestpublic javax.ws.rs.core.Response cropTemporaryAvatar(Avatar.Type type, String ownerId, AvatarCroppingBean croppingInstructions)
public javax.ws.rs.core.Response deleteAvatar(Long id)
id
- database id for avatarCopyright © 2002-2016 Atlassian. All Rights Reserved.