java.lang.Object | +--javax.mail.internet.ContentType
This class represents a MIME ContentType value. It provides methods to parse a ContentType string into individual components and to generate a MIME style ContentType string.
ContentType() No-arg Constructor. | |
ContentType(java.lang.String s) Constructor that takes a Content-Type string. | |
ContentType(java.lang.String primaryType, java.lang.String subType,ParameterList list) Constructor. |
getBaseType() Return the MIME type string, without the parameters. | |
getParameter(java.lang.String name) Return the specified parameter value. | |
getParameterList() Return a ParameterList object that holds all the available parameters. | |
getPrimaryType() Return the primary type. | |
getSubType() Return the subType. | |
match(ContentType cType) Match with the specified ContentType object. | |
match(java.lang.String s) Match with the specified content-type string. | |
setParameter(java.lang.String name, java.lang.String value) Set the specified parameter. | |
setParameterList(ParameterList list) Set a new ParameterList. | |
setPrimaryType(java.lang.String primaryType) Set the primary type. | |
setSubType(java.lang.String subType) Set the subType. | |
toString() Retrieve a RFC2045 style string representation of this Content-Type. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
publicContentType()
publicContentType(java.lang.String primaryType, java.lang.String subType,ParameterList list)
primaryType
- primary typesubType
- subTypelist
- ParameterListpublicContentType(java.lang.String s) throwsParseException
s
- the Content-Type string.ParseException
- if the parse fails.public java.lang.StringgetPrimaryType()
public java.lang.StringgetSubType()
public java.lang.StringgetBaseType()
public java.lang.StringgetParameter(java.lang.String name)
null
if this parameter is absent.publicParameterListgetParameterList()
public voidsetPrimaryType(java.lang.String primaryType)
primaryType
- primary typepublic voidsetSubType(java.lang.String subType)
type
- subTypepublic voidsetParameter(java.lang.String name, java.lang.String value)
name
- parameter namevalue
- parameter valuepublic voidsetParameterList(ParameterList list)
list
- ParameterListpublic java.lang.StringtoString()
null
if the conversion failed.toString
in classjava.lang.Object
public booleanmatch(ContentType cType)
primaryType
andsubType
. The parameters of both operands are ignored. For example, this method will returntrue
when comparing the ContentTypes for"text/plain" and"text/plain; charset=foobar". If thesubType
of either operand is the special character '*', then the subtype is ignored during the match. For example, this method will returntrue
when comparing the ContentTypes for"text/plain" and"text/*"
ContentType
- to compare this againstpublic booleanmatch(java.lang.String s)
primaryType
andsubType
. The parameters of both operands are ignored. For example, this method will returntrue
when comparing the ContentType for"text/plain" with"text/plain; charset=foobar". If thesubType
of either operand is the special character '*', then the subtype is ignored during the match. For example, this method will returntrue
when comparing the ContentType for"text/plain" with"text/*"