org.apache.any23.http
Class AcceptHeaderBuilder
java.lang.Object
org.apache.any23.http.AcceptHeaderBuilder
public class AcceptHeaderBuilder
- extends Object
Concatenates a collection of MIME specs in "type/subtype;q=x.x" notation
into an HTTP Accept header value, and removes duplicates and types
covered by wildcards. For example, if the type list contains "text/*;q=0.5",
then "text/plain;q=0.1" in the list will be ignored because it's already
covered by the wildcard with a higher q value.
- Author:
- Richard Cyganiak (richard@cyganiak.de)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AcceptHeaderBuilder
public AcceptHeaderBuilder(Collection<MIMEType> mimeTypes)
fromStrings
public static AcceptHeaderBuilder fromStrings(Collection<String> typesAsStrings)
getAcceptHeader
public String getAcceptHeader()
- Builds and returns an accept header.
- Throws:
IllegalArgumentException
- if an input MIME type cannot be parsed.
Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.