Package org.somda.sdc.dpws.http
Class ContentType
- java.lang.Object
-
- org.somda.sdc.dpws.http.ContentType
-
public class ContentType extends Object
Handler for parsing Content-Types accepted by SDCri.This is currently limited to three content-types: text/xml, application/xml and application/soap+xml.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classContentType.ContentTypesRepresentation of all accepted content-types as well as their default charset, if it is given.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Optional<ContentType>fromApache(org.apache.http.Header header)Parses the content-type Header element provided by apache http client.static Optional<ContentType>fromListMultimap(com.google.common.collect.ListMultimap<String,String> headers)Parses the content-type entry from aListMultimapcontaining header entries.StringgetBoundary()CharsetgetCharset()ContentType.ContentTypesgetContentType()StringtoString()
-
-
-
Method Detail
-
fromListMultimap
public static Optional<ContentType> fromListMultimap(com.google.common.collect.ListMultimap<String,String> headers)
Parses the content-type entry from aListMultimapcontaining header entries. Http header keys must be lower case, i.e. content-type, not Content-Type/- Parameters:
headers- to parse content-type from- Returns:
- parsed content-type if successful, empty optional otherwise
-
fromApache
public static Optional<ContentType> fromApache(@Nullable org.apache.http.Header header)
Parses the content-type Header element provided by apache http client.- Parameters:
header- to parse content-type from- Returns:
- parsed content-type if parseable, empty optional otherweise
-
getCharset
public Charset getCharset()
-
getContentType
public ContentType.ContentTypes getContentType()
-
getBoundary
public String getBoundary()
-
-