public abstract class AbstractAvatarServlet
extends javax.servlet.http.HttpServlet
Constructor and Description |
---|
AbstractAvatarServlet() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
avatarOkForOwner(String ownerId,
Avatar avatar) |
protected void |
defaultDoGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String ownerId,
Long avatarId,
AvatarManager.ImageSize size)
Template method that processes the GET request.
|
protected void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
protected AvatarManager |
getAvatarManager() |
protected AvatarToStream |
getAvatarToStream() |
protected String |
getOwnerId(javax.servlet.http.HttpServletRequest request) |
protected abstract String |
getOwnerIdParamName()
Slight hack to stay backwards compatible for project avatars via the 'pid' param.
|
protected static void |
handleOutputStreamingException(javax.servlet.http.HttpServletResponse response,
boolean bytesWritten,
Exception e) |
protected abstract Long |
validateInput(String ownerId,
Long avatarId,
javax.servlet.http.HttpServletResponse response)
Ensures the input is valid and if validation passes returns a valid avatarId
to serve.
|
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException
doGet
in class javax.servlet.http.HttpServlet
javax.servlet.ServletException
IOException
protected String getOwnerId(javax.servlet.http.HttpServletRequest request)
protected void defaultDoGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String ownerId, Long avatarId, AvatarManager.ImageSize size) throws IOException, javax.servlet.ServletException
IOException
javax.servlet.ServletException
protected static void handleOutputStreamingException(javax.servlet.http.HttpServletResponse response, boolean bytesWritten, Exception e) throws IOException, javax.servlet.ServletException
IOException
javax.servlet.ServletException
protected abstract Long validateInput(String ownerId, Long avatarId, javax.servlet.http.HttpServletResponse response) throws IOException
ownerId
- The owner of the avataravatarId
- The avatarId requestedresponse
- The response to sendIOException
- If there's an error updating the response objectprotected abstract String getOwnerIdParamName()
protected final AvatarManager getAvatarManager()
protected final AvatarToStream getAvatarToStream()
Copyright © 2002-2015 Atlassian. All Rights Reserved.