Class RangeRequest
java.lang.Object
com.atlassian.confluence.web.rangerequest.RangeRequest
- All Implemented Interfaces:
Comparable<RangeRequest>
Represents a valid HTTP byte range request
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.1
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRangeRequest
(long firstByte, long contentLength) RangeRequest
(long firstByte, long lastByte, long contentLength) -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(RangeRequest that) long
long
getEnd()
long
long
static RangeRequest
Parse a range header value into a RangeRequest
-
Field Details
-
RANGE_PATTERN
-
-
Constructor Details
-
RangeRequest
public RangeRequest(long firstByte, long contentLength) -
RangeRequest
public RangeRequest(long firstByte, long lastByte, long contentLength)
-
-
Method Details
-
getOffset
public long getOffset() -
getEnd
public long getEnd() -
getRangeLength
public long getRangeLength() -
getContentLength
public long getContentLength() -
parse
public static RangeRequest parse(String headerValue, long contentLength) throws RangeNotSatisfiableException Parse a range header value into a RangeRequest- Parameters:
headerValue
- the string value of the header- Returns:
- a RangeRequest representing the contents of the header value
- Throws:
UnsupportedOperationException
- if the header value cannot be parsedRangeNotSatisfiableException
- if the header value cannot be parsed
-
compareTo
- Specified by:
compareTo
in interfaceComparable<RangeRequest>
-