com.atlassian.jira.web.servlet
Class AbstractViewFileServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.atlassian.jira.web.servlet.AbstractViewFileServlet
- All Implemented Interfaces:
- Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
- Direct Known Subclasses:
- ViewAttachmentServlet
public abstract class AbstractViewFileServlet
- extends javax.servlet.http.HttpServlet
- See Also:
- Serialized Form
Method Summary |
protected String |
attachmentPath(javax.servlet.http.HttpServletRequest request)
Validates that path is valid attachment path. |
protected void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
protected abstract File |
getFileName(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Gets the attachment file (not the file name) that corresponds to the requested attachment. |
protected String |
getUserName()
|
protected abstract void |
setResponseHeaders(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Sets any required headers on the http response. |
Methods inherited from class javax.servlet.http.HttpServlet |
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service |
Methods inherited from class javax.servlet.GenericServlet |
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractViewFileServlet
public AbstractViewFileServlet()
doGet
protected void doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
IOException
- Overrides:
doGet
in class javax.servlet.http.HttpServlet
- Throws:
javax.servlet.ServletException
IOException
attachmentPath
protected final String attachmentPath(javax.servlet.http.HttpServletRequest request)
- Validates that path is valid attachment path.
- Parameters:
request
- HTTP request
- Returns:
- attachment path
getFileName
protected abstract File getFileName(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws DataAccessException,
IOException,
PermissionException
- 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.
setResponseHeaders
protected abstract void setResponseHeaders(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws DataAccessException,
IOException
- Sets any required headers on the http response.
- Parameters:
request
- HTTP requestresponse
- HTTP response
- Throws:
DataAccessException
IOException
getUserName
protected final String getUserName()
- Returns:
- The logged-in user's name, or null (anonymous)
Copyright © 2002-2009 Atlassian. All Rights Reserved.