Interface AvatarService


public interface AvatarService
Provides URLs from which avatar images can be retrieved.
  • 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

      @Nonnull String getUrlForProject(@Nonnull Project project, @Nonnull 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
    • getUrlForPerson

      @Nonnull String getUrlForPerson(@Nonnull Person person, @Nonnull 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
    • getUrlForReviewerGroup

      @Nonnull String getUrlForReviewerGroup(@Nonnull ReviewerGroup group, @Nonnull AvatarRequest request)
      Retrieves a URL referencing an avatar for the provided pull request reviewer group.

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

      Parameters:
      group - the group whose avatar is being requested
      request - a request describing the avatar being requested
      Returns:
      a URL referencing an avatar for the provided group
      Since:
      7.13