public abstract class

AbstractViewFileServlet

extends HttpServlet
java.lang.Object
   ↳ javax.servlet.GenericServlet
     ↳ javax.servlet.http.HttpServlet
       ↳ com.atlassian.jira.web.servlet.AbstractViewFileServlet
Known Direct Subclasses
Known Indirect Subclasses

Summary

Public Constructors
AbstractViewFileServlet()
Protected Methods
final String attachmentPath(HttpServletRequest request)
Validates that path is valid attachment path.
void doGet(HttpServletRequest request, HttpServletResponse response)
abstract File getFileName(HttpServletRequest request, HttpServletResponse response)
Gets the attachment file (not the file name) that corresponds to the requested attachment.
JiraAuthenticationContext getJiraAuthenticationContext()
final String getUserName()
abstract void setResponseHeaders(HttpServletRequest request, HttpServletResponse response)
Sets any required headers on the http response.
[Expand]
Inherited Methods
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 AbstractViewFileServlet ()

Protected Methods

protected final String attachmentPath (HttpServletRequest request)

Validates that path is valid attachment path.

Parameters
request HTTP request
Returns
  • attachment path

protected void doGet (HttpServletRequest request, HttpServletResponse response)

Throws
ServletException
IOException

protected abstract File getFileName (HttpServletRequest request, HttpServletResponse response)

Gets the attachment file (not the file name) that corresponds to the requested attachment.

Parameters
request the http request.
response the http response.
Returns
  • the File resource for the attachment.
Throws
DataAccessException If there is a problem looking up the data to support the attachment.
IOException if there is a problem getting the File.
PermissionException if the user has insufficient permission to see the attachment.
InvalidAttachmentPathException if the path to the attachment was invalid in some way.

protected JiraAuthenticationContext getJiraAuthenticationContext ()

protected final String getUserName ()

Returns
  • The logged-in user's name, or null (anonymous)

protected abstract void setResponseHeaders (HttpServletRequest request, HttpServletResponse response)

Sets any required headers on the http response.

Parameters
request HTTP request
response HTTP response