javax.mail.internet
Class ContentType
java.lang.Object
javax.mail.internet.ContentType
public class ContentType
extends java.lang.Object
A MIME Content-Type value.
ContentType() - Constructor for an empty Content-Type.
|
ContentType(String s) - Constructor that parses a Content-Type value from an RFC 2045 string
representation.
|
ContentType(String primaryType, String subType, ParameterList list) - Constructor.
|
ContentType
public ContentType()
Constructor for an empty Content-Type.
ContentType
public ContentType(String s)
throws ParseException
Constructor that parses a Content-Type value from an RFC 2045 string
representation.
s
- the Content-Type value
ContentType
public ContentType(String primaryType,
String subType,
ParameterList list)
Constructor.
primaryType
- the primary typesubType
- the subtypelist
- the parameters
getBaseType
public String getBaseType()
Returns the MIME type string, without the parameters.
getParameter
public String getParameter(String name)
Returns the specified parameter value.
getParameterList
public ParameterList getParameterList()
Returns the parameters.
getPrimaryType
public String getPrimaryType()
Returns the primary type.
getSubType
public String getSubType()
Returns the subtype.
match
public boolean match(String s)
Returns true if the specified Content-Type matches this Content-Type.
Parameters are ignored.
If the subtype of either Content-Type is the special character '*',
the subtype is ignored during the match.
s
- the RFC 2045 string representation of the Content-Type to match
match
public boolean match(ContentType cType)
Returns true if the specified Content-Type matches this Content-Type.
Parameters are ignored.
If the subtype of either Content-Type is the special character '*',
the subtype is ignored during the match.
cType
- the Content-Type for comparison
setParameter
public void setParameter(String name,
String value)
Sets the specified parameter.
name
- the parameter namevalue
- the parameter value
setParameterList
public void setParameterList(ParameterList list)
Sets the parameters.
list
- the Parameter list
setPrimaryType
public void setPrimaryType(String primaryType)
Sets the primary type.
setSubType
public void setSubType(String subType)
Sets the subtype.
toString
public String toString()
Returns an RFC 2045 string representation of this Content-Type.
© Copyright 2003, 2004
The Free Software Foundation, All rights reserved