Package org.somda.sdc.dpws.http
Class ContentType
-
- All Implemented Interfaces:
public class ContentTypeHandler 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 public enumContentType.ContentTypesRepresentation of all accepted content-types as well as their default charset, if it is given.
-
Field Summary
Fields Modifier and Type Field Description public final ContentType.ContentTypescontentTypepublic final Charsetcharsetpublic final Stringboundary
-
Method Summary
Modifier and Type Method Description ContentType.ContentTypesgetContentType()CharsetgetCharset()StringgetBoundary()static Optional<ContentType>fromListMultimap(ListMultimap<String, String> headers)Parses the content-type entry from a ListMultimap containing header entries. static Optional<ContentType>fromApache(@Nullable() Header header)Parses the content-type Header element provided by apache http client. StringtoString()-
-
Method Detail
-
getContentType
ContentType.ContentTypes getContentType()
-
getCharset
Charset getCharset()
-
getBoundary
String getBoundary()
-
fromListMultimap
static Optional<ContentType> fromListMultimap(ListMultimap<String, String> headers)
Parses the content-type entry from a ListMultimap containing 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
static Optional<ContentType> fromApache(@Nullable() 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
-
-
-
-