com.atlassian.jira.avatar
Class AvatarPickerHelperImpl

java.lang.Object
  extended by com.atlassian.jira.avatar.AvatarPickerHelperImpl
All Implemented Interfaces:
AvatarPickerHelper

public class AvatarPickerHelperImpl
extends Object
implements AvatarPickerHelper

Since:
v5.0

Nested Class Summary
static class AvatarPickerHelperImpl.Result<T>
           
static class AvatarPickerHelperImpl.TemporaryAvatarBean
           
 
Constructor Summary
AvatarPickerHelperImpl(AvatarManager avatarManager, JiraAuthenticationContext authenticationContext, ApplicationProperties properties, VelocityRequestContextFactory requestContextFactory, ProjectManager projectManager, UserUtil userUtil)
           
 
Method Summary
 AvatarPickerHelperImpl.Result<Avatar> convertTemporaryToReal(String ownerId, Avatar.Type type, Selection selection)
          Converts temporary avatar (uploaded) to real avatar
 AvatarPickerHelperImpl.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
 AvatarPickerHelperImpl.Result<AvatarPickerHelperImpl.TemporaryAvatarBean> upload(InputStream stream, String fileName, String contentType, long size, String ownerId, Avatar.Type type)
          Handles upload of temporary avatar
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AvatarPickerHelperImpl

public AvatarPickerHelperImpl(AvatarManager avatarManager,
                              JiraAuthenticationContext authenticationContext,
                              ApplicationProperties properties,
                              VelocityRequestContextFactory requestContextFactory,
                              ProjectManager projectManager,
                              UserUtil userUtil)
Method Detail

upload

public AvatarPickerHelperImpl.Result<AvatarPickerHelperImpl.TemporaryAvatarBean> upload(InputStream stream,
                                                                                        String fileName,
                                                                                        String contentType,
                                                                                        long size,
                                                                                        String ownerId,
                                                                                        Avatar.Type type)
Description copied from interface: AvatarPickerHelper
Handles upload of temporary avatar

Specified by:
upload in interface AvatarPickerHelper
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

convertTemporaryToReal

public AvatarPickerHelperImpl.Result<Avatar> convertTemporaryToReal(String ownerId,
                                                                    Avatar.Type type,
                                                                    Selection selection)
Description copied from interface: AvatarPickerHelper
Converts temporary avatar (uploaded) to real avatar

Specified by:
convertTemporaryToReal in interface AvatarPickerHelper
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

cropTemporary

public AvatarPickerHelperImpl.Result<AvatarPickerHelperImpl.TemporaryAvatarBean> cropTemporary(String ownerId,
                                                                                               Avatar.Type type,
                                                                                               Selection selection)
Description copied from interface: AvatarPickerHelper
Crops the temporary avatar (uploaded) using the given selection.

Specified by:
cropTemporary in interface AvatarPickerHelper
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

getTemporaryAvatarUrl

public String getTemporaryAvatarUrl()
Description copied from interface: AvatarPickerHelper
Gets temporary avatar url

Specified by:
getTemporaryAvatarUrl in interface AvatarPickerHelper
Returns:
temporary avatar url


Copyright © 2002-2014 Atlassian. All Rights Reserved.