use of org.apache.jena.atlas.web.MediaRange in project jena by apache.
the class ConNeg method match.
/**
* Match a single media type against a header string.
*
* @param headerString HTTP header string
* @param mediaRangeStr Semi-colon separated list of media types
* @return the matched media type or <code>null</code> if there was no match
*/
public static String match(String headerString, String mediaRangeStr) {
AcceptList l = new AcceptList(headerString);
// MediaType
MediaRange aItem = new MediaRange(mediaRangeStr);
MediaType m = l.match(aItem);
if (m == null)
return null;
return m.toHeaderString();
}
use of org.apache.jena.atlas.web.MediaRange in project jena by apache.
the class ConNeg method match.
/**
* Match a single media type against a header string.
*
* @param headerString HTTP header string
* @param mediaRangeStr Semi-colon separated list of media types
* @return the matched media type or <code>null</code> if there was no match
*/
public static String match(String headerString, String mediaRangeStr) {
AcceptList l = new AcceptList(headerString);
// MediaType
MediaRange aItem = new MediaRange(mediaRangeStr);
MediaType m = l.match(aItem);
if (m == null)
return null;
return m.toHeaderString();
}
Aggregations