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 attachmentQuery(HttpServletRequest request)
Validates that path is valid attachment path.
void doGet(HttpServletRequest request, HttpServletResponse response)
abstract void getInputStream(String attachmentPath, InputStreamConsumer<Unit> consumer)
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 the content type, content length and "Content-Disposition" header of the response based on the values of the attachement found.
[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 attachmentQuery (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 void getInputStream (String attachmentPath, InputStreamConsumer<Unit> consumer)

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

Parameters
attachmentPath the attachment path
consumer a procedure that consumes the stream with the attachment data.
Throws
DataAccessException If there is a problem looking up the data to support the attachment.
AttachmentNotFoundException if the attachment does not exist.
PermissionException if the user has insufficient permission to see the attachment.
IOException if there is a problem getting the attachment.
NoAttachmentDataException if the attachment's contents cannot be found.
AttachmentReadException if a problem occurs when the consumer processes the attachment's contents.

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 the content type, content length and "Content-Disposition" header of the response based on the values of the attachement found.

Parameters
request HTTP request
response HTTP response