Class RangeResponse

java.lang.Object
com.atlassian.jira.web.servlet.viewfile.RangeResponse

public class RangeResponse extends Object
Represents a partial range of bytes to be returned in a partial HTTP request.
Since:
v7.2
  • Constructor Details

    • RangeResponse

      public RangeResponse(int startIndex, Integer endIndex, int totalFileLength)
  • Method Details

    • getStartIndex

      public int getStartIndex()
    • getEndIndex

      public Integer getEndIndex()
    • calculateContentLength

      public int calculateContentLength()
      Calculates the "Content-Length" response header value.

      That is, the number of bytes we will return, based on the requested range and also the actual length of the file. See https://tools.ietf.org/html/rfc7233#section-4.1

      Returns:
      the number of bytes we will return for this range.
    • calculateContentRange

      public String calculateContentRange()
      Calculates the "Content-Range" response header value.

      eg "Content-Range: bytes 21010-47021/47022" See https://tools.ietf.org/html/rfc7233#section-4.1

      Returns:
      the number of bytes we will return for this range.
    • toString

      public String toString()
      Overrides:
      toString in class Object