Class ViewThumbnailServlet

java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.atlassian.jira.web.servlet.viewfile.AbstractViewFileServlet
com.atlassian.jira.web.servlet.viewfile.ViewThumbnailServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class ViewThumbnailServlet extends AbstractViewFileServlet
See Also:
  • Constructor Details

    • ViewThumbnailServlet

      public ViewThumbnailServlet()
  • Method Details

    • getContentLength

      protected int getContentLength(String attachmentPath)
      Specified by:
      getContentLength in class AbstractViewFileServlet
    • supportsRangeRequests

      protected boolean supportsRangeRequests()
      Description copied from class: AbstractViewFileServlet
      Returns true if this implementation supports RFC 7233 "Range Requests".

      Returning true means that you must set the appropriate "Content-Range" and "Content-Length" headers for the partial range we will return in the #setResponseHeaders implementation.

      Specified by:
      supportsRangeRequests in class AbstractViewFileServlet
      Returns:
      true if this servlet supports RFC 7233 "Range Requests".
    • getInputStream

      protected void getInputStream(javax.servlet.http.HttpServletRequest request, String attachmentPath, InputStreamConsumer<io.atlassian.fugue.Unit> consumer) throws IOException, PermissionException
      Description copied from class: AbstractViewFileServlet
      Gets the attachment file (not the file name) that corresponds to the requested attachment.
      Specified by:
      getInputStream in class AbstractViewFileServlet
      attachmentPath - the attachment path
      consumer - a procedure that consumes the stream with the attachment data.
      Throws:
      IOException - if there is a problem getting the attachment.
      PermissionException
    • setResponseContentHeaders

      protected void setResponseContentHeaders(javax.servlet.http.HttpServletRequest request, Optional<RangeResponse> rangeResponse, javax.servlet.http.HttpServletResponse response, Optional<Long> contentLength)
      Description copied from class: AbstractViewFileServlet
      Sets the content type, content length and "Content-Disposition" header of the response based on the values of the attachment found.

      The rangeResponse parameter will only be present if this Concrete class declares it supports Range Requests, and the request actually contains a Range header.

      Specified by:
      setResponseContentHeaders in class AbstractViewFileServlet
      Parameters:
      request - HTTP request
      rangeResponse - If present, the partial byte range we will return
      response - HTTP response
      contentLength - the length of the content we are returning in bytes, if known
      See Also: