Package org.fcrepo.http.commons.domain
Class Range
java.lang.Object
org.fcrepo.http.commons.domain.Range
Range header parsing logic
- Author:
- awoods, whikloj
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents a range object based on length -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic RangeConvert an HTTP Range header to a Range objectprotected longend()End of the rangeprotected booleanhasRange()Does this range actually impose limitsrangeOfLength(long length) Create a range object with start and end bytes based on the length of the content.protected longsize()Length contained in the rangeprotected longstart()Start of the range
-
Constructor Details
-
Range
Left-bounded range- Parameters:
start- the start
-
-
Method Details
-
hasRange
Does this range actually impose limits- Returns:
- true if the range imposes limits
-
size
Length contained in the range- Returns:
- length of the range
-
start
Start of the range- Returns:
- start of the range, or -1 if no start was specified
-
end
End of the range- Returns:
- end of the range
-
convert
Convert an HTTP Range header to a Range object- Parameters:
source- the source- Returns:
- range object
-
rangeOfLength
Create a range object with start and end bytes based on the length of the content.- Parameters:
length- the length of the content- Returns:
- a range of length object
-