Class ViewUserAvatarServlet

java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.atlassian.jira.web.servlet.AbstractAvatarServlet
com.atlassian.jira.web.servlet.ViewUserAvatarServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class ViewUserAvatarServlet extends AbstractAvatarServlet
Serves avatar images for users.
Since:
v4.2
See Also:
  • Constructor Details

    • ViewUserAvatarServlet

      public ViewUserAvatarServlet()
  • Method Details

    • defaultDoGet

      protected void defaultDoGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String ownerId, Long avatarId, Avatar.Size size) throws IOException, javax.servlet.ServletException
      Description copied from class: AbstractAvatarServlet
      Template method that processes the GET request. Subclasses may override this method to change the avatar serving logic.
      Overrides:
      defaultDoGet in class AbstractAvatarServlet
      Throws:
      IOException
      javax.servlet.ServletException
    • preprocessInput

      protected AbstractAvatarServlet.PreprocessedInput preprocessInput(String ownerId, Long avatarId, Avatar.Size size, javax.servlet.http.HttpServletResponse response) throws IOException
      Description copied from class: AbstractAvatarServlet
      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.
      Specified by:
      preprocessInput in class AbstractAvatarServlet
      Parameters:
      ownerId - The owner of the avatar
      avatarId - The avatarId requested
      size - The size of requested avatar
      response - The response to send
      Returns:
      The object containing avatarId to serve to the user or object containing null avatarId if validation fails
      Throws:
      IOException - If there's an error updating the response object
    • getOwnerId

      protected String getOwnerId(javax.servlet.http.HttpServletRequest request)
      Overrides:
      getOwnerId in class AbstractAvatarServlet
    • getOwnerIdParamName

      protected String getOwnerIdParamName()
      Description copied from class: AbstractAvatarServlet
      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.
      Specified by:
      getOwnerIdParamName in class AbstractAvatarServlet
      Returns:
      The parameter used to identify the owner in the request.