Class UserProfileAvatarResource
- java.lang.Object
-
- com.atlassian.bamboo.plugins.rest.resource.UserProfileAvatarResource
-
@Singleton public class UserProfileAvatarResource extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static SimpleDateFormat
LAST_MODIFIED_DATE_FORMAT
-
Constructor Summary
Constructors Constructor Description UserProfileAvatarResource(BambooUserManager userManager, AvatarService avatarService, HigherOrderAvatarProvider higherOrderAvatarProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.ws.rs.core.Response
deleteAvatar(com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
javax.ws.rs.core.Response
retrieveAvatar(String userName, int size, com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext, javax.servlet.http.HttpServletRequest request)
protected javax.ws.rs.core.Response
streamAvatar(CacheableAvatarSupplier supplier, javax.servlet.http.HttpServletRequest request)
Streams the providedavatar
, automatically handling "If-Modified-Since" and "Last-Modified" headers to encourage browsers to cache avatars.javax.ws.rs.core.Response
uploadAvatar(com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext, com.atlassian.plugins.rest.common.multipart.FilePart file)
-
-
-
Field Detail
-
LAST_MODIFIED_DATE_FORMAT
public static final SimpleDateFormat LAST_MODIFIED_DATE_FORMAT
-
-
Constructor Detail
-
UserProfileAvatarResource
public UserProfileAvatarResource(BambooUserManager userManager, AvatarService avatarService, HigherOrderAvatarProvider higherOrderAvatarProvider)
-
-
Method Detail
-
retrieveAvatar
public javax.ws.rs.core.Response retrieveAvatar(String userName, int size, @Context com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext, @Context javax.servlet.http.HttpServletRequest request)
-
uploadAvatar
public javax.ws.rs.core.Response uploadAvatar(@Context com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext, com.atlassian.plugins.rest.common.multipart.FilePart file)
-
deleteAvatar
public javax.ws.rs.core.Response deleteAvatar(@Context com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
-
streamAvatar
protected javax.ws.rs.core.Response streamAvatar(CacheableAvatarSupplier supplier, javax.servlet.http.HttpServletRequest request)
Streams the providedavatar
, automatically handling "If-Modified-Since" and "Last-Modified" headers to encourage browsers to cache avatars.- Parameters:
supplier
- a supplier providing access to the avatar data to streamrequest
- the HTTP request to retrieve the avatar- Throws:
IOException
- if the avatar cannot be read from the provided supplier, or written to the provided response
-
-