Class RangeRequest
- java.lang.Object
-
- com.atlassian.confluence.web.rangerequest.RangeRequest
-
- All Implemented Interfaces:
Comparable<RangeRequest>
public class RangeRequest extends Object implements Comparable<RangeRequest>
Represents a valid HTTP byte range request http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.1
-
-
Field Summary
Fields Modifier and Type Field Description static Pattern
RANGE_PATTERN
-
Constructor Summary
Constructors Constructor Description RangeRequest(long firstByte, long contentLength)
RangeRequest(long firstByte, long lastByte, long contentLength)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(RangeRequest that)
long
getContentLength()
long
getEnd()
long
getOffset()
long
getRangeLength()
static RangeRequest
parse(String headerValue, long contentLength)
Parse a range header value into a RangeRequest
-
-
-
Field Detail
-
RANGE_PATTERN
public static final Pattern RANGE_PATTERN
-
-
Method Detail
-
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
public int compareTo(RangeRequest that)
- Specified by:
compareTo
in interfaceComparable<RangeRequest>
-
-