MCPcopy Index your code
hub / github.com/apache/tomcat / parsePriority

Method parsePriority

java/org/apache/tomcat/util/http/parser/Priority.java:99–121  ·  view source on GitHub ↗

Parsers an HTTP header as a Priority header as defined by RFC 9218. @param input The header to parse @return The resulting priority @throws IOException If an I/O error occurs while reading the input

(Reader input)

Source from the content-addressed store, hash-verified

97 * @throws IOException If an I/O error occurs while reading the input
98 */
99 public static Priority parsePriority(Reader input) throws IOException {
100 Priority result = new Priority();
101
102 SfDictionary dictionary = StructuredField.parseSfDictionary(input);
103
104 SfListMember urgencyListMember = dictionary.getDictionaryMember("u");
105 // If not an integer, ignore it
106 if (urgencyListMember instanceof SfInteger) {
107 long urgency = ((SfInteger) urgencyListMember).getValue().longValue();
108 // If out of range, ignore it
109 if (urgency > -1 && urgency < 8) {
110 result.setUrgency((int) urgency);
111 }
112 }
113
114 SfListMember incrementalListMember = dictionary.getDictionaryMember("i");
115 // If not a boolean, ignore it
116 if (incrementalListMember instanceof SfBoolean) {
117 result.setIncremental(((SfBoolean) incrementalListMember).getValue().booleanValue());
118 }
119
120 return result;
121 }
122}

Callers 3

testOnlyIncrementalMethod · 0.95
emitHeaderMethod · 0.95

Calls 6

parseSfDictionaryMethod · 0.95
getDictionaryMemberMethod · 0.95
setUrgencyMethod · 0.95
setIncrementalMethod · 0.95
getValueMethod · 0.65
booleanValueMethod · 0.45

Tested by 1

testOnlyIncrementalMethod · 0.76