public interface

AvatarService

com.atlassian.bitbucket.avatar.AvatarService

Class Overview

Provides URLs from which avatar images can be retrieved.

Summary

Public Methods
long getMaxUploadSize()
Retrieves the maximum size, in bytes, for uploaded avatars.
@Nonnull String getUrlForPerson(Person person, AvatarRequest request)
Retrieves a URL referencing an avatar for the provided person.
@Nonnull String getUrlForProject(Project project, AvatarRequest request)
Retrieves a URL referencing an avatar for the provided project.

Public Methods

public 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

@Nonnull public String getUrlForPerson (Person person, AvatarRequest request)

Retrieves a URL referencing an avatar for the provided person.

Implementations of this interface shall not return null. If no avatar is available for the provided person, the URL of a default avatar is returned.

Parameters
person the person whose avatar is being requested
request a request describing the avatar being requested
Returns
  • a URL referencing an avatar for the provided person

@Nonnull public String getUrlForProject (Project project, AvatarRequest request)

Retrieves a URL referencing an avatar for the provided project.

Implementations of this interface shall not return null. If no avatar is available for the provided project, 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 requested
request a request describing the avatar being requested
Returns
  • a URL referencing an avatar for the provided project