java.lang.Object |
↳ |
javax.servlet.GenericServlet |
|
↳ |
javax.servlet.http.HttpServlet |
|
|
↳ |
com.atlassian.jira.web.servlet.AbstractAvatarServlet |
Known Direct Subclasses
|
Known Indirect Subclasses
ViewTemporaryAvatarServlet |
Streams out an avatar image that has just been uploaded so that cropping/scaling operations can be performed. |
|
Class Overview
Abstract servlet to serve avatar images
Summary
Protected Methods |
boolean
|
avatarOkForOwner(String ownerId, Avatar avatar)
|
void
|
defaultDoGet(HttpServletRequest request, HttpServletResponse response, String ownerId, Long avatarId, Avatar.Size size)
Template method that processes the GET request.
|
void
|
doGet(HttpServletRequest request, HttpServletResponse response)
|
final
AvatarManager
|
getAvatarManager()
|
final
AvatarToStream
|
getAvatarToStream()
|
String
|
getOwnerId(HttpServletRequest request)
|
abstract
String
|
getOwnerIdParamName()
Slight hack to stay backwards compatible for project avatars via the 'pid' param.
|
static
void
|
handleOutputStreamingException(HttpServletResponse response, boolean bytesWritten, Exception e)
|
abstract
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
javax.servlet.http.HttpServlet
void
|
doDelete(HttpServletRequest arg0, HttpServletResponse arg1)
|
void
|
doGet(HttpServletRequest arg0, HttpServletResponse arg1)
|
void
|
doHead(HttpServletRequest arg0, HttpServletResponse arg1)
|
void
|
doOptions(HttpServletRequest arg0, HttpServletResponse arg1)
|
void
|
doPost(HttpServletRequest arg0, HttpServletResponse arg1)
|
void
|
doPut(HttpServletRequest arg0, HttpServletResponse arg1)
|
void
|
doTrace(HttpServletRequest arg0, HttpServletResponse arg1)
|
long
|
getLastModified(HttpServletRequest arg0)
|
void
|
service(HttpServletRequest arg0, HttpServletResponse arg1)
|
void
|
service(ServletRequest arg0, ServletResponse arg1)
|
|
From class
javax.servlet.GenericServlet
void
|
destroy()
|
String
|
getInitParameter(String arg0)
|
Enumeration<String>
|
getInitParameterNames()
|
ServletConfig
|
getServletConfig()
|
ServletContext
|
getServletContext()
|
String
|
getServletInfo()
|
String
|
getServletName()
|
void
|
init(ServletConfig arg0)
|
void
|
init()
|
void
|
log(String arg0)
|
void
|
log(String arg0, Throwable arg1)
|
abstract
void
|
service(ServletRequest arg0, ServletResponse arg1)
|
|
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
From interface
javax.servlet.Servlet
void
|
destroy()
|
ServletConfig
|
getServletConfig()
|
String
|
getServletInfo()
|
void
|
init(ServletConfig arg0)
|
void
|
service(ServletRequest arg0, ServletResponse arg1)
|
|
From interface
javax.servlet.ServletConfig
|
Public Constructors
public
AbstractAvatarServlet
()
Protected Methods
protected
boolean
avatarOkForOwner
(String ownerId, Avatar avatar)
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.
protected
void
doGet
(HttpServletRequest request, HttpServletResponse response)
protected
String
getOwnerId
(HttpServletRequest request)
protected
abstract
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
static
void
handleOutputStreamingException
(HttpServletResponse response, boolean bytesWritten, Exception e)
protected
abstract
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
| If there's an error updating the response object
|