|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.mail.internet.ContentType
public class ContentType
A MIME Content-Type value.
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
String |
getBaseType()
Returns the MIME type string, without the parameters. |
String |
getParameter(String name)
Returns the specified parameter value. |
ParameterList |
getParameterList()
Returns the parameters. |
String |
getPrimaryType()
Returns the primary type. |
String |
getSubType()
Returns the subtype. |
boolean |
match(ContentType cType)
Returns true if the specified Content-Type matches this Content-Type. |
boolean |
match(String s)
Returns true if the specified Content-Type matches this Content-Type. |
void |
setParameter(String name,
String value)
Sets the specified parameter. |
void |
setParameterList(ParameterList list)
Sets the parameters. |
void |
setPrimaryType(String primaryType)
Sets the primary type. |
void |
setSubType(String subType)
Sets the subtype. |
String |
toString()
Returns an RFC 2045 string representation of this Content-Type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ContentType()
public ContentType(String primaryType, String subType, ParameterList list)
primaryType
- the primary typesubType
- the subtypelist
- the parameterspublic ContentType(String s) throws ParseException
s
- the Content-Type value
ParseException
- if an error occurred during parsingMethod Detail |
---|
public String getPrimaryType()
public String getSubType()
public String getBaseType()
public String getParameter(String name)
public ParameterList getParameterList()
public void setPrimaryType(String primaryType)
public void setSubType(String subType)
public void setParameter(String name, String value)
name
- the parameter namevalue
- the parameter valuepublic void setParameterList(ParameterList list)
list
- the Parameter listpublic String toString()
toString
in class Object
public boolean match(ContentType cType)
If the subtype of either Content-Type is the special character '*', the subtype is ignored during the match.
cType
- the Content-Type for comparisonpublic boolean match(String s)
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |