com.atlassian.confluence.web.rangerequest
Class RangeRequest

java.lang.Object
  extended by 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
static Pattern RANGE_PATTERN
           
 
Constructor Summary
RangeRequest(long firstByte, long contentLength)
           
RangeRequest(long firstByte, long lastByte, long contentLength)
           
 
Method Summary
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RANGE_PATTERN

public static final Pattern RANGE_PATTERN
Constructor Detail

RangeRequest

public RangeRequest(long firstByte,
                    long contentLength)

RangeRequest

public RangeRequest(long firstByte,
                    long lastByte,
                    long contentLength)
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 parsed
RangeNotSatisfiableException - if the header value cannot be parsed

compareTo

public int compareTo(RangeRequest that)
Specified by:
compareTo in interface Comparable<RangeRequest>


Copyright © 2003–2015 Atlassian. All rights reserved.