Package 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)
-
-
Constructor Summary
Constructors Constructor Description AcceptHeaderBuilder(Collection<MIMEType> mimeTypes)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AcceptHeaderBuilder
fromStrings(Collection<String> typesAsStrings)
String
getAcceptHeader()
Builds and returns an accept header.
-
-
-
Constructor Detail
-
AcceptHeaderBuilder
public AcceptHeaderBuilder(Collection<MIMEType> mimeTypes)
-
-
Method Detail
-
fromStrings
public static AcceptHeaderBuilder fromStrings(Collection<String> typesAsStrings)
-
getAcceptHeader
public String getAcceptHeader()
Builds and returns an accept header.- Returns:
- the accept header.
-
-