Package org.duracloud.storage.domain
Class ContentByteRange
java.lang.Object
org.duracloud.storage.domain.ContentByteRange
Handles the parsing and validation of HTTP Range headers for Range-based
content requests
- Author:
- Bill Branan Date: 4/20/18
-
Constructor Summary
ConstructorsConstructorDescriptionContentByteRange(String range) Captures the start and end values described in an HTTP Range header -
Method Summary
Modifier and TypeMethodDescriptionGets the ending point of the byte range (the number following the "-"), or null if there is no number following the dashGets the starting point of the byte range (the number preceding the "-"), or null if there is no number preceding the dashProvides text describing how the Range header value is to be used, and noting that the provided range is invalid.protected voidparseRange(String range) Parses the Range HTTP header value.
-
Constructor Details
-
ContentByteRange
Captures the start and end values described in an HTTP Range header- Parameters:
range- HTTP Range header with format 'bytes=X-Y'
-
-
Method Details
-
getRangeStart
Gets the starting point of the byte range (the number preceding the "-"), or null if there is no number preceding the dash -
getRangeEnd
Gets the ending point of the byte range (the number following the "-"), or null if there is no number following the dash -
parseRange
Parses the Range HTTP header value. Only a single range is supported (others are dropped).- Parameters:
range- Range header included in HTTP request- Throws:
IllegalArgumentException- if range value is not valid
-
getUsage
Provides text describing how the Range header value is to be used, and noting that the provided range is invalid.- Parameters:
range- invalid range value- Returns:
-