Package com.atlassian.bitbucket.avatar
Interface AvatarService
public interface AvatarService
Provides URLs from which avatar images can be retrieved.
-
Method Summary
Modifier and TypeMethodDescriptionlongRetrieves the maximum size, in bytes, for uploaded avatars.getUrlForPerson(Person person, AvatarRequest request) Retrieves a URL referencing an avatar for the providedperson.getUrlForProject(Project project, AvatarRequest request) Retrieves a URL referencing an avatar for the providedproject.getUrlForReviewerGroup(ReviewerGroup group, AvatarRequest request) Retrieves a URL referencing an avatar for the provided pull requestreviewer group.
-
Method Details
-
getMaxUploadSize
long getMaxUploadSize()Retrieves the maximum size, in bytes, for uploaded avatars. Avatars larger than this will be rejected by the server.- Returns:
- the maximum size, in bytes, for uploaded avatars
- Since:
- 4.13
-
getUrlForProject
Retrieves a URL referencing an avatar for the providedproject.Implementations of this interface shall not return
null. If no avatar is available for the providedproject, the URL of a default avatar is returned. The default avatar for a project will be randomly assigned, but will be stable once set.- Parameters:
project- the project whose avatar is being requestedrequest- a request describing the avatar being requested- Returns:
- a URL referencing an avatar for the provided
project
-
getUrlForPerson
Retrieves a URL referencing an avatar for the providedperson.Implementations of this interface shall not return
null. If no avatar is available for the providedperson, the URL of a default avatar is returned.- Parameters:
person- the person whose avatar is being requestedrequest- a request describing the avatar being requested- Returns:
- a URL referencing an avatar for the provided
person
-
getUrlForReviewerGroup
@Nonnull String getUrlForReviewerGroup(@Nonnull ReviewerGroup group, @Nonnull AvatarRequest request) Retrieves a URL referencing an avatar for the provided pull requestreviewer group.Implementations of this interface shall not return
null. If no avatar is available for the providedgroup, the URL of a default avatar is returned.- Parameters:
group- the group whose avatar is being requestedrequest- a request describing the avatar being requested- Returns:
- a URL referencing an avatar for the provided
group - Since:
- 7.13
-