@Deprecated public class

AvatarRequest

extends Object
java.lang.Object
   ↳ com.atlassian.stash.user.AvatarRequest
Known Direct Subclasses

This class is deprecated.
Deprecated in 2.1 for removal in 3.0. This class is being moved into its own package, along with the other avatar-related objects. Callers should use AvatarRequest instead.

Class Overview

Describes an avatar being requested, allowing callers control over certain avatar properties.

Summary

Public Constructors
AvatarRequest(boolean secure, int size)
useConfigured is defaulted to false
AvatarRequest(boolean secure, int size, boolean useConfigured)
Constructs a new AvatarRequest for the provided scheme and size.
Public Methods
int getSize()
Retrieves the size desired for the avatar.
boolean isSecure()
Retrieves a flag indicating whether avatar URLs should use HTTPS.
boolean isUseConfigured()
Retrieve the URL using the configured base URL.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public AvatarRequest (boolean secure, int size)

useConfigured is defaulted to false

public AvatarRequest (boolean secure, int size, boolean useConfigured)

Constructs a new AvatarRequest for the provided scheme and size.

The secure flag allows the caller to control whether avatar URLs use HTTP or HTTPS. The size controls the dimensions of the avatar returned.

Parameters
secure true if avatar URLs should use HTTPS; otherwise, false for HTTP
size the height/width of the avatar being requested
useConfigured whether to use the configured base URL; if false the request context will be used instead
Throws
IllegalArgumentException if the provided size is less than 1.
NullPointerException if the provided scheme is null.

Public Methods

public int getSize ()

Retrieves the size desired for the avatar. Avatars are assumed to be square, so the size is used for both the height and the width.

Returns
  • the size

public boolean isSecure ()

Retrieves a flag indicating whether avatar URLs should use HTTPS. If the flag is true, the returned URLs will use HTTPS; otherwise, they will use HTTP.

Returns
  • the scheme

public boolean isUseConfigured ()

Retrieve the URL using the configured base URL. This flag is only applicable to avatar sources which serve from the current application. Avatars hosted remotely ignore this flag

Returns
  • true if the URL should use the configured base URL. false otherwise