Movatterモバイル変換


[0]ホーム

URL:


         


Class MimeType

java.lang.Object  |  +--javax.activation.MimeType
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable

public classMimeType
extends java.lang.Object
implements java.io.Externalizable

A Multipurpose Internet Mail Extension (MIME) type, as defined in RFC 2045 and 2046.

See Also:
Serialized Form

MimeType()
          Default constructor.
MimeType(java.lang.String rawdata)
          Constructor that builds a MimeType from a String.
MimeType(java.lang.String primary, java.lang.String sub)
          Constructor that builds a MimeType with the given primary and sub type but has an empty parameter list.
 
getBaseType()
          Return a String representation of this object without the parameter list.
getParameter(java.lang.String name)
          Retrieve the value associated with the given name, or null if there is no current association.
getParameters()
          Retrieve this object's parameter list.
getPrimaryType()
          Retrieve the primary type of this object.
getSubType()
          Retrieve the sub type of this object.
match(MimeType type)
          Determine if the primary and sub type of this object is the same as what is in the given type.
match(java.lang.String rawdata)
          Determine if the primary and sub type of this object is the same as the content type described in rawdata.
readExternal(java.io.ObjectInput in)
          The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays.
removeParameter(java.lang.String name)
          Remove any value associated with the given name.
setParameter(java.lang.String name, java.lang.String value)
          Set the value to be associated with the given name, replacing any previous association.
setPrimaryType(java.lang.String primary)
          Set the primary type for this object to the given String.
setSubType(java.lang.String sub)
          Set the sub type for this object to the given String.
toString()
          Return the String representation of this object.
writeExternal(java.io.ObjectOutput out)
          The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings and arrays.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

MimeType

publicMimeType()
Default constructor.

MimeType

publicMimeType(java.lang.String rawdata)         throwsMimeTypeParseException
Constructor that builds a MimeType from a String.
Parameters:
rawdata - the MIME type string

MimeType

publicMimeType(java.lang.String primary,                java.lang.String sub)         throwsMimeTypeParseException
Constructor that builds a MimeType with the given primary and sub type but has an empty parameter list.
Parameters:
primary - the primary MIME type
sub - the MIME sub-type

getPrimaryType

public java.lang.StringgetPrimaryType()
Retrieve the primary type of this object.
Returns:
the primary MIME type

setPrimaryType

public voidsetPrimaryType(java.lang.String primary)                    throwsMimeTypeParseException
Set the primary type for this object to the given String.
Parameters:
primary - the primary MIME type

getSubType

public java.lang.StringgetSubType()
Retrieve the sub type of this object.
Returns:
the MIME sub-type

setSubType

public voidsetSubType(java.lang.String sub)                throwsMimeTypeParseException
Set the sub type for this object to the given String.
Parameters:
sub - the MIME sub-type

getParameters

publicMimeTypeParameterListgetParameters()
Retrieve this object's parameter list.
Returns:
a MimeTypeParameterList object representing the parameters

getParameter

public java.lang.StringgetParameter(java.lang.String name)
Retrieve the value associated with the given name, or null if there is no current association.
Parameters:
name - the parameter name
Returns:
the paramter's value

setParameter

public voidsetParameter(java.lang.String name,                         java.lang.String value)
Set the value to be associated with the given name, replacing any previous association.
Parameters:
name - the parameter name
value - the paramter's value

removeParameter

public voidremoveParameter(java.lang.String name)
Remove any value associated with the given name.
Parameters:
name - the parameter name

toString

public java.lang.StringtoString()
Return the String representation of this object.
Overrides:
toString in classjava.lang.Object

getBaseType

public java.lang.StringgetBaseType()
Return a String representation of this object without the parameter list.
Returns:
the MIME type and sub-type

match

public booleanmatch(MimeType type)
Determine if the primary and sub type of this object is the same as what is in the given type.
Parameters:
type - the MimeType object to compare with
Returns:
true if they match

match

public booleanmatch(java.lang.String rawdata)              throwsMimeTypeParseException
Determine if the primary and sub type of this object is the same as the content type described in rawdata.
Parameters:
rawdata - the MIME type string to compare with
Returns:
true if they match

writeExternal

public voidwriteExternal(java.io.ObjectOutput out)                   throws java.io.IOException
The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings and arrays.
Specified by:
writeExternal in interfacejava.io.Externalizable
Parameters:
out - the ObjectOutput object to write to
Throws:
java.io.IOException - Includes any I/O exceptions that may occur

readExternal

public voidreadExternal(java.io.ObjectInput in)                  throws java.io.IOException,                         java.lang.ClassNotFoundException
The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. The readExternal method must read the values in the same sequence and with the same types as were written by writeExternal.
Specified by:
readExternal in interfacejava.io.Externalizable
Parameters:
in - the IbjectInput object to read from
Throws:
java.lang.ClassNotFoundException - If the class for an object being restored cannot be found.

         


[8]ページ先頭

©2009-2025 Movatter.jp