Movatterモバイル変換


[0]ホーム

URL:


         


Class ContentType

java.lang.Object  |  +--javax.mail.internet.ContentType

public classContentType
extends java.lang.Object

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
 

ContentType

publicContentType()
No-arg Constructor.

ContentType

publicContentType(java.lang.String primaryType,                   java.lang.String subType,ParameterList list)
Constructor.
Parameters:
primaryType - primary type
subType - subType
list - ParameterList

ContentType

publicContentType(java.lang.String s)            throwsParseException
Constructor that takes a Content-Type string. The String is parsed into its constituents: primaryType, subType and parameters. A ParseException is thrown if the parse fails.
Parameters:
s - the Content-Type string.
Throws:
ParseException - if the parse fails.

getPrimaryType

public java.lang.StringgetPrimaryType()
Return the primary type.
Returns:
the primary type

getSubType

public java.lang.StringgetSubType()
Return the subType.
Returns:
the subType

getBaseType

public java.lang.StringgetBaseType()
Return the MIME type string, without the parameters. The returned value is basically the concatenation of the primaryType, the '/' character and the secondaryType.
Returns:
the type

getParameter

public java.lang.StringgetParameter(java.lang.String name)
Return the specified parameter value. Returnsnull if this parameter is absent.
Returns:
parameter value

getParameterList

publicParameterListgetParameterList()
Return a ParameterList object that holds all the available parameters. Returns null if no parameters are available.
Returns:
ParameterList

setPrimaryType

public voidsetPrimaryType(java.lang.String primaryType)
Set the primary type. Overrides existing primary type.
Parameters:
primaryType - primary type

setSubType

public voidsetSubType(java.lang.String subType)
Set the subType. Overrides existing subType
Parameters:
type - subType

setParameter

public voidsetParameter(java.lang.String name,                         java.lang.String value)
Set the specified parameter. If this parameter already exists, it is replaced by this new value.
Parameters:
name - parameter name
value - parameter value

setParameterList

public voidsetParameterList(ParameterList list)
Set a new ParameterList.
Parameters:
list - ParameterList

toString

public java.lang.StringtoString()
Retrieve a RFC2045 style string representation of this Content-Type. Returnsnull if the conversion failed.
Overrides:
toString in classjava.lang.Object
Returns:
RFC2045 style string

match

public booleanmatch(ContentType cType)
Match with the specified ContentType object. This method comparesonly theprimaryType 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/*"

Parameters:
ContentType - to compare this against

match

public booleanmatch(java.lang.String s)
Match with the specified content-type string. This method comparesonly theprimaryType 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/*"


         


[8]ページ先頭

©2009-2025 Movatter.jp