javax.mail.internet

Class 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:
1.3

Author:
Chris Burdess

Field Summary

static String
MIME
MIME specials
static String
RFC822
RFC822 specials

Constructor Summary

HeaderTokenizer(String header)
Constructor.
HeaderTokenizer(String headerill return true when comparing the ContentType for "text/plain" with "text/*"

Parameters:
s - the string representation of the content type to match


match

public 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/*"

Parameters:
cType - the content type to compare this against


setParameter

public void setParameter(String name,
                         String value)
Set the specified parameter. If this parameter already exists, it is replaced by this new value.

Parameters:
name - the parameter name
value - the parameter value


setParameterList

public void setParameterList(ParameterList list)
Set a new parameter list.

Parameters:
list - the Parameter list


setPrimaryType

public void setPrimaryType(String primaryType)
Set the primary type. Overrides existing primary type.

Parameters:
primaryType - the primary type


setSubType

public void setSubType(String subType)
Set the subtype. Overrides existing subtype

Parameters:


toString

public String toString()
Retrieve a RFC2045 style string representation of this Content-Type. Returns null if the conversion failed.

Returns:
RFC2045 style string


© Copyright 2003, 2004 The Free Software Foundation, All rights reserved./usr/share/doc/libgnumail-java/apidoc/javax/mail/internet/ContentType-uses.html0000644000000000000000000000673410227707575030162 0ustar rootroot00000000000000 ContentType (GNU JavaMail API documentation)

Uses of Class javax.mail.internet.ContentType

Uses in package javax.mail.internet