@PublicApi
public interface AvatarService
Avatars
.Modifier and Type | Method and Description |
---|---|
boolean |
canSetCustomUserAvatar(ApplicationUser remoteUser,
ApplicationUser user)
Returns a boolean indicating whether the calling user can edit the custom user avatar for the user with the given
username.
|
boolean |
canSetCustomUserAvatar(ApplicationUser remoteUser,
String username)
Deprecated.
Use
canSetCustomUserAvatar(ApplicationUser, ApplicationUser) . Since v6.0 |
Avatar |
getAvatar(ApplicationUser remoteUser,
ApplicationUser avatarUser)
Returns the Avatar for the given user, if configured.
|
Avatar |
getAvatar(ApplicationUser remoteUser,
String username)
Deprecated.
Use
getAvatar(ApplicationUser, ApplicationUser) . Since v6.0 |
URI |
getAvatarAbsoluteURL(ApplicationUser remoteUser,
ApplicationUser avatarUser,
Avatar.Size size)
This is the same as
getAvatarURL(ApplicationUser, String, Avatar.Size)
but returns an absolute URL. |
URI |
getAvatarAbsoluteURL(ApplicationUser remoteUser,
String username,
Avatar.Size size)
Deprecated.
Use
#getAvatarAbsoluteURL(ApplicationUser, ApplicationUser, Size) . Since v6.0 |
Avatar |
getAvatarTagged(ApplicationUser remoteUser,
ApplicationUser avatarUser) |
URI |
getAvatarURL(ApplicationUser remoteUser,
ApplicationUser avatarUser)
Returns the URL for the avatar of the user having the given username for displaying on a page that should be
shown for the passed in remoteUser.
|
URI |
getAvatarURL(ApplicationUser remoteUser,
ApplicationUser avatarUser,
Avatar.Size size)
Returns the URL for the avatar of the user having the given username for displaying on a page that should be
shown for the passed in remoteUser.
|
URI |
getAvatarURL(ApplicationUser remoteUser,
String username)
Deprecated.
Use
getAvatarURL(ApplicationUser, ApplicationUser) . Since v6.0 |
URI |
getAvatarURL(ApplicationUser remoteUser,
String username,
Avatar.Size size)
Deprecated.
Use
#getAvatarURL(ApplicationUser, ApplicationUser, Size) . Since v6.0 |
URI |
getAvatarUrlNoPermCheck(ApplicationUser avatarUser,
Avatar.Size size)
This is the same as
#getAvatarURL(ApplicationUser, String, Size) but does no permission checking. |
URI |
getAvatarUrlNoPermCheck(ApplicationUser applicationUser,
Avatar avatar,
Avatar.Size size)
Deprecated.
|
URI |
getAvatarUrlNoPermCheck(String username,
Avatar.Size size)
Deprecated.
Use
#getAvatarUrlNoPermCheck(ApplicationUser, Size) . Since v6.0 |
Optional<URI> |
getGravatarAvatarURL(ApplicationUser avatarUser,
Avatar.Size size)
If Gravatar is enabled returns Gravatar url for given user at given size.
|
URI |
getProjectAvatarAbsoluteURL(Project project,
Avatar.Size size)
Returns the URL for the avatar of the given project.
|
URI |
getProjectAvatarURL(Project project,
Avatar.Size size)
Returns the URL for the avatar of the given project.
|
URI |
getProjectDefaultAvatarAbsoluteURL(Avatar.Size size)
Returns the URL for the default avatar of a project.
|
URI |
getProjectDefaultAvatarURL(Avatar.Size size)
Returns the URL for the default avatar of a project.
|
boolean |
hasCustomUserAvatar(ApplicationUser remoteUser,
ApplicationUser username)
Returns true if the user has configured a custom avatar, false otherwise.
|
boolean |
hasCustomUserAvatar(ApplicationUser remoteUser,
String username)
Deprecated.
|
boolean |
isGravatarEnabled()
Deprecated.
this is an avatar-provider plugin-implementation-specific concern
|
boolean |
isUsingExternalAvatar(ApplicationUser remoteUser,
ApplicationUser avatarUser)
Check whether a user currently has an external avatar (for example, a Gravatar).
|
void |
setCustomUserAvatar(ApplicationUser remoteUser,
ApplicationUser user,
Long avatarId)
Sets a custom avatar for a given user.
|
void |
setCustomUserAvatar(ApplicationUser remoteUser,
String username,
Long avatarId)
Deprecated.
Use
setCustomUserAvatar(ApplicationUser, ApplicationUser, Long) . Since v6.0 |
Avatar getAvatar(ApplicationUser remoteUser, String username) throws AvatarsDisabledException
getAvatar(ApplicationUser, ApplicationUser)
. Since v6.0If this method would return the default user avatar but none is configured, or if this method would return the anonymous avatar but none is configured, this method returns null.
remoteUser
- the User that wants to view an Avatarusername
- a String containing a username (may have been deleted)AvatarsDisabledException
- if avatars are disabledAvatar getAvatar(ApplicationUser remoteUser, ApplicationUser avatarUser) throws AvatarsDisabledException
If this method would return the default user avatar but none is configured, or if this method would return the anonymous avatar but none is configured, this method returns null.
remoteUser
- the User that wants to view an AvataravatarUser
- the User that the avatar will be returned for (if null it will return a default avatar if it's set or null)AvatarsDisabledException
- if avatars are disabledURI getAvatarURL(ApplicationUser remoteUser, String username) throws AvatarsDisabledException
getAvatarURL(ApplicationUser, ApplicationUser)
. Since v6.0If the user does not have a custom avatar, or if the calling user does not have permission to view the Avatar, this method returns the URL of the default avatar. If the user does not exist, this method returns the URL of the anonymous avatar.
remoteUser
- a User object for the currently logged in userusername
- a String containing a username (may have been deleted)AvatarsDisabledException
- if avatars are disabledgetAvatar(ApplicationUser, String)
URI getAvatarURL(ApplicationUser remoteUser, ApplicationUser avatarUser) throws AvatarsDisabledException
If the user does not have a custom avatar, or if the calling user does not have permission to view the Avatar, this method returns the URL of the default avatar. If the user does not exist, this method returns the URL of the anonymous avatar.
remoteUser
- a User object for the currently logged in useravatarUser
- a User object to get the avatar for (if null, the default avatar is used)AvatarsDisabledException
- if avatars are disabledgetAvatar(ApplicationUser, String)
URI getAvatarURL(ApplicationUser remoteUser, String username, Avatar.Size size) throws AvatarsDisabledException
#getAvatarURL(ApplicationUser, ApplicationUser, Size)
. Since v6.0If the user does not have a custom avatar, or if the calling user does not have permission to view the Avatar, this method returns the URL of the default avatar. If the user does not exist, this method returns the URL of the anonymous avatar.
remoteUser
- a User object for the currently logged in userusername
- a String containing a username (may have been deleted)size
- the size of the avatar to be displayed (if null, the default size is used)AvatarsDisabledException
- if avatars are disabledgetAvatar(ApplicationUser, String)
URI getAvatarURL(ApplicationUser remoteUser, ApplicationUser avatarUser, Avatar.Size size) throws AvatarsDisabledException
If the user does not have a custom avatar, or if the calling user does not have permission to view the Avatar, this method returns the URL of the default avatar. If the user does not exist, this method returns the URL of the anonymous avatar.
remoteUser
- a User object for the currently logged in useravatarUser
- a User to get the avatar for (if null, the default avatar is used)size
- the size of the avatar to be displayed (if null, the default size is used)AvatarsDisabledException
- if avatars are disabledgetAvatar(ApplicationUser, String)
Optional<URI> getGravatarAvatarURL(ApplicationUser avatarUser, Avatar.Size size)
avatarUser
- a User to get the avatar for (if null, Optional.empty() is returned)size
- the size of the avatar to be displayed (if null, the default size is used)URI getAvatarUrlNoPermCheck(String username, Avatar.Size size) throws AvatarsDisabledException
#getAvatarUrlNoPermCheck(ApplicationUser, Size)
. Since v6.0#getAvatarURL(ApplicationUser, String, Size)
but does no permission checking.username
- a String containing a username (may have been deleted)size
- the size of the avatar to be displayedAvatarsDisabledException
- if avatars are disabledURI getAvatarUrlNoPermCheck(ApplicationUser avatarUser, Avatar.Size size) throws AvatarsDisabledException
#getAvatarURL(ApplicationUser, String, Size)
but does no permission checking.avatarUser
- a String containing a username (if null, the default avatar is used)size
- the size of the avatar to be displayedAvatarsDisabledException
- if avatars are disabled@Deprecated URI getAvatarUrlNoPermCheck(ApplicationUser applicationUser, Avatar avatar, @Nonnull Avatar.Size size) throws AvatarsDisabledException
applicationUser
- size
- the size of the avatar to be displayed (if null, the default size is used)AvatarsDisabledException
- if avatars are disabledgetAvatar(ApplicationUser, String)
URI getAvatarAbsoluteURL(ApplicationUser remoteUser, String username, Avatar.Size size) throws AvatarsDisabledException
#getAvatarAbsoluteURL(ApplicationUser, ApplicationUser, Size)
. Since v6.0getAvatarURL(ApplicationUser, String, Avatar.Size)
but returns an absolute URL.AvatarsDisabledException
URI getAvatarAbsoluteURL(ApplicationUser remoteUser, ApplicationUser avatarUser, Avatar.Size size) throws AvatarsDisabledException
getAvatarURL(ApplicationUser, String, Avatar.Size)
but returns an absolute URL.AvatarsDisabledException
URI getProjectAvatarURL(Project project, Avatar.Size size)
If running in the context of a web request, this will return a URL relative to the server root (ie "/jira/..."). Otherwise, it will return an absolute URL (eg. "http://example.com/jira/...").
project
- the Project of which to get the avatar URLsize
- the size of the avatar to be displayed (if null, the default size is used)URI getProjectAvatarAbsoluteURL(Project project, Avatar.Size size)
This will always return an absolute URL (eg. "http://example.com/jira/...").
project
- the Project of which to get the avatar URLsize
- the size of the avatar to be displayed (if null, the default size is used)URI getProjectDefaultAvatarURL(Avatar.Size size)
If running in the context of a web request, this will return a URL relative to the server root (ie "/jira/..."). Otherwise, it will return an absolute URL (eg. "http://example.com/jira/...").
size
- the size of the avatar to be displayed (if null, the default size is used)URI getProjectDefaultAvatarAbsoluteURL(Avatar.Size size)
This will always return an absolute URL (eg. "http://example.com/jira/...").
size
- the size of the avatar to be displayed (if null, the default size is used)@ExperimentalApi boolean hasCustomUserAvatar(ApplicationUser remoteUser, String username)
hasCustomUserAvatar(ApplicationUser remoteUser, ApplicationUser username)
. Since v6.0remoteUser
- a User object for the currently logged in userusername
- the username of the user whose avatar we will check@ExperimentalApi boolean hasCustomUserAvatar(ApplicationUser remoteUser, ApplicationUser username)
remoteUser
- a User object for the currently logged in userusername
- the username of the user whose avatar we will check@ExperimentalApi @Deprecated boolean isGravatarEnabled()
boolean isUsingExternalAvatar(ApplicationUser remoteUser, ApplicationUser avatarUser)
getAvatarURL(ApplicationUser, ApplicationUser)
to get the avatar URL.@ExperimentalApi void setCustomUserAvatar(ApplicationUser remoteUser, String username, Long avatarId) throws AvatarsDisabledException, NoPermissionException
setCustomUserAvatar(ApplicationUser, ApplicationUser, Long)
. Since v6.0remoteUser
- a User object for the currently logged in userusername
- the username of the user whose avatar we will configureavatarId
- the id of the avatar to configure for the userAvatarsDisabledException
- if avatars are disabledNoPermissionException
- if the remote user does not have permission to update the given user's avatarcanSetCustomUserAvatar(ApplicationUser, String)
@ExperimentalApi void setCustomUserAvatar(ApplicationUser remoteUser, ApplicationUser user, Long avatarId) throws AvatarsDisabledException, NoPermissionException
remoteUser
- a User object for the currently logged in useruser
- the user whose avatar we will configureavatarId
- the id of the avatar to configure for the userAvatarsDisabledException
- if avatars are disabledNoPermissionException
- if the remote user does not have permission to update the given user's avatarcanSetCustomUserAvatar(ApplicationUser, String)
@ExperimentalApi boolean canSetCustomUserAvatar(ApplicationUser remoteUser, String username)
canSetCustomUserAvatar(ApplicationUser, ApplicationUser)
. Since v6.0remoteUser
- a User object for the currently logged in userusername
- the username of the user whose avatar we will configure@ExperimentalApi boolean canSetCustomUserAvatar(ApplicationUser remoteUser, ApplicationUser user)
remoteUser
- a User object for the currently logged in useruser
- the user whose avatar we will configureAvatar getAvatarTagged(ApplicationUser remoteUser, ApplicationUser avatarUser) throws AvatarsDisabledException
AvatarsDisabledException
Copyright © 2002-2021 Atlassian. All Rights Reserved.