public class ContentTypeFieldImpl extends AbstractField implements ContentTypeField
Content-Type field.| Modifier and Type | Field and Description |
|---|---|
static FieldParser<ContentTypeField> |
PARSER |
monitor, rawFieldPARAM_BOUNDARY, PARAM_CHARSET, TYPE_MESSAGE_RFC822, TYPE_MULTIPART_DIGEST, TYPE_MULTIPART_PREFIX, TYPE_TEXT_PLAIN| Modifier and Type | Method and Description |
|---|---|
String |
getBoundary()
Gets the value of the
boundary parameter if set. |
String |
getCharset()
Gets the value of the
charset parameter if set. |
static String |
getCharset(ContentTypeField f)
Gets the value of the
charset parameter if set for the
given field. |
String |
getMediaType()
Gets the media type defined in this Content-Type field.
|
String |
getMimeType()
Gets the MIME type defined in this Content-Type field.
|
static String |
getMimeType(ContentTypeField child,
ContentTypeField parent)
Gets the MIME type defined in the child's Content-Type field or derives a
MIME type from the parent if child is
null or hasn't got a
MIME type value set. |
String |
getParameter(String name)
Gets the value of a parameter.
|
Map<String,String> |
getParameters()
Gets all parameters.
|
ParseException |
getParseException()
Returns the exception that was thrown by the field parser while parsing
the field value.
|
String |
getSubType()
Gets the subtype defined in this Content-Type field.
|
boolean |
isMimeType(String mimeType)
Determines if the MIME type of this field matches the given one.
|
boolean |
isMultipart()
Determines if the MIME type of this field is
multipart/*. |
getBody, getName, getRaw, getRawField, isValidField, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisValidFieldpublic static final FieldParser<ContentTypeField> PARSER
public ParseException getParseException()
ParsedFieldnull if the field is valid
and no errors were encountered.getParseException in interface ParsedFieldgetParseException in class AbstractFieldnull if the field is valid.ParsedField.getParseException()public String getMimeType()
ContentTypeFieldgetMimeType in interface ContentTypeFieldContentTypeField.getMimeType()public String getMediaType()
ContentTypeFieldgetMediaType in interface ContentTypeFieldContentTypeField.getMediaType()public String getSubType()
ContentTypeFieldgetSubType in interface ContentTypeFieldContentTypeField.getSubType()public String getParameter(String name)
ContentTypeFieldgetParameter in interface ContentTypeFieldname - the name of the parameter to get.null if not set.ContentTypeField.getParameter(java.lang.String)public Map<String,String> getParameters()
ContentTypeFieldgetParameters in interface ContentTypeFieldContentTypeField.getParameters()public boolean isMimeType(String mimeType)
ContentTypeFieldisMimeType in interface ContentTypeFieldmimeType - the MIME type to match against.true if the MIME type of this field matches,
false otherwise.ContentTypeField.isMimeType(java.lang.String)public boolean isMultipart()
ContentTypeFieldmultipart/*.isMultipart in interface ContentTypeFieldtrue if this field is has a
multipart/* MIME type, false
otherwise.ContentTypeField.isMultipart()public String getBoundary()
ContentTypeFieldboundary parameter if set.getBoundary in interface ContentTypeFieldboundary parameter value or null
if not set.ContentTypeField.getBoundary()public String getCharset()
ContentTypeFieldcharset parameter if set.getCharset in interface ContentTypeFieldcharset parameter value or null
if not set.ContentTypeField.getCharset()public static String getMimeType(ContentTypeField child, ContentTypeField parent)
null or hasn't got a
MIME type value set. If child's MIME type is multipart but no boundary
has been set the MIME type of child will be derived from the parent.child - the child.parent - the parent.public static String getCharset(ContentTypeField f)
charset parameter if set for the
given field. Returns the default us-ascii if not set or if
f is null.charset parameter value.Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.