* @return The content type.
*/
private ContentType createContentType(StringBuilder mediaType,
Series<Parameter> parameters) {
// Attempt to extract the character set
CharacterSet characterSet = null;
if (parameters != null) {
String charSet = parameters.getFirstValue("charset");
if (charSet != null) {
parameters.removeAll("charset");
characterSet = new CharacterSet(charSet);
}
return new ContentType(new MediaType(mediaType.toString(),
parameters), characterSet);
}