Class Ranges
java.lang.Object
org.apache.tomcat.util.http.parser.Ranges
Represents the value of an HTTP Range header.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents a single range entry with a start and end position. -
Constructor Summary
ConstructorsConstructorDescriptionRanges(String units, List<Ranges.Entry> entries) Creates a new Ranges instance. -
Method Summary
Modifier and TypeMethodDescriptionReturns the list of range entries.getUnits()Returns the range units (e.g., "bytes").static Rangesparse(StringReader input) Parses a Range header from an HTTP header.
-
Constructor Details
-
Ranges
Creates a new Ranges instance.- Parameters:
units- the range units (e.g., "bytes"), or nullentries- the list of range entries
-
-
Method Details
-
getEntries
Returns the list of range entries.- Returns:
- an unmodifiable list of range entries
-
getUnits
Returns the range units (e.g., "bytes").- Returns:
- the range units, or null if not specified
-
parse
Parses a Range header from an HTTP header.- Parameters:
input- a reader over the header text- Returns:
- a set of ranges parsed from the input, or null if not valid
- Throws:
IOException- if there was a problem reading the input
-