public abstract class AbstractAvatarServlet
extends javax.servlet.http.HttpServlet
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractAvatarServlet.PreprocessedInput |
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,
Avatar.Size size)
Template method that processes the GET request.
|
protected void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
protected Optional<AvatarManager> |
getAvatarManager() |
protected AvatarToStream |
getAvatarToStream() |
protected Optional<FeatureManager> |
getFeatureManager() |
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 boolean |
isFeatureEnabled(FeatureFlag featureFlag,
boolean whenFeatureManagerNotPresent) |
protected abstract AbstractAvatarServlet.PreprocessedInput |
preprocessInput(String ownerId,
Long avatarId,
Avatar.Size size,
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, Avatar.Size 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
@Nonnull protected abstract AbstractAvatarServlet.PreprocessedInput preprocessInput(String ownerId, Long avatarId, Avatar.Size size, javax.servlet.http.HttpServletResponse response) throws IOException
ownerId
- The owner of the avataravatarId
- The avatarId requestedsize
- The size of requested avatarresponse
- The response to sendIOException
- If there's an error updating the response objectprotected abstract String getOwnerIdParamName()
protected final Optional<AvatarManager> getAvatarManager()
protected final Optional<FeatureManager> getFeatureManager()
protected boolean isFeatureEnabled(@Nonnull FeatureFlag featureFlag, boolean whenFeatureManagerNotPresent)
protected final AvatarToStream getAvatarToStream()
Copyright © 2002-2021 Atlassian. All Rights Reserved.