javax.mail.internet
Class HeaderTokenizer
java.lang.Objectjavax.mail.internet.HeaderTokenizer
public class HeaderTokenizer
extends java.lang.Object
This class tokenizes RFC822 and MIME headers into the basic symbols
specified by RFC822 and MIME.
This class handles folded headers (ie headers with embedded CRLF SPACE
sequences). The folds are removed in the returned tokens.
Version:
- Chris Burdess
static String | MIME- MIME specials
|
static String | RFC822- RFC822 specials
|
HeaderTokenizer(String header)- Constructor.
|
HeaderTokenizer(String headerill return true when comparing the
ContentType for "text/plain" with "text/*"
s - the string representation of the content type to match
matchpublic boolean match(ContentType cType) Match with the specified ContentType object.
This method compares only the primaryType and subType.
The parameters of both operands are ignored.
For example, this method will return true when comparing the
ContentTypes for "text/plain" and "text/plain; charset=foobar".
If the subType of either operand is the special character '*', then
the subtype is ignored during the match.
For example, this method will return true when comparing the
ContentTypes for "text/plain" and "text/*"
cType - the content type to compare this against
setParameterpublic void setParameter(String name,
String value) Set the specified parameter.
If this parameter already exists, it is replaced by this new value.
name - the parameter namevalue - the parameter value
setParameterListpublic void setParameterList(ParameterList list) Set a new parameter list.
list - the Parameter list
setPrimaryTypepublic void setPrimaryType(String primaryType) Set the primary type.
Overrides existing primary type.
primaryType - the primary type
setSubTypepublic void setSubType(String subType) Set the subtype.
Overrides existing subtype
toStringpublic String toString() Retrieve a RFC2045 style string representation of this Content-Type.
Returns null if the conversion failed.
- RFC2045 style string
© Copyright 2003, 2004
The Free Software Foundation, All rights reserved
|