public class

ViewUserAvatarServlet

extends AbstractAvatarServlet
java.lang.Object
   ↳ javax.servlet.GenericServlet
     ↳ javax.servlet.http.HttpServlet
       ↳ com.atlassian.jira.web.servlet.AbstractAvatarServlet
         ↳ com.atlassian.jira.web.servlet.ViewUserAvatarServlet

Class Overview

Serves avatar images for users.

Summary

Public Constructors
ViewUserAvatarServlet()
Protected Methods
void defaultDoGet(HttpServletRequest request, HttpServletResponse response, String ownerId, Long avatarId, Avatar.Size size)
Template method that processes the GET request.
String getOwnerId(HttpServletRequest request)
String getOwnerIdParamName()
Slight hack to stay backwards compatible for project avatars via the 'pid' param.
Long validateInput(String ownerId, Long avatarId, HttpServletResponse response)
Ensures the input is valid and if validation passes returns a valid avatarId to serve.
[Expand]
Inherited Methods
From class com.atlassian.jira.web.servlet.AbstractAvatarServlet
From class javax.servlet.http.HttpServlet
From class javax.servlet.GenericServlet
From class java.lang.Object
From interface javax.servlet.Servlet
From interface javax.servlet.ServletConfig

Public Constructors

public ViewUserAvatarServlet ()

Protected Methods

protected void defaultDoGet (HttpServletRequest request, HttpServletResponse response, String ownerId, Long avatarId, Avatar.Size size)

Template method that processes the GET request. Subclasses may override this method to change the avatar serving logic.

Throws
IOException
ServletException

protected String getOwnerId (HttpServletRequest request)

protected String getOwnerIdParamName ()

Slight hack to stay backwards compatible for project avatars via the 'pid' param. The project avatar servlet implementation can return pid here instead of ownerId.

Returns
  • The parameter used to identify the owner in the request.

protected Long validateInput (String ownerId, Long avatarId, HttpServletResponse response)

Ensures the input is valid and if validation passes returns a valid avatarId to serve. If validation fails, this method should send errors on the response and return a null avatar id.

Parameters
ownerId The owner of the avatar
avatarId The avatarId requested
response The response to send
Returns
  • The avatarId to serve to the user or null if validation fails
Throws
IOException