java.lang.Object | +--javax.activation.MimeType
A Multipurpose Internet Mail Extension (MIME) type, as defined in RFC 2045 and 2046.
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 |
publicMimeType()
publicMimeType(java.lang.String rawdata) throwsMimeTypeParseException
rawdata
- the MIME type stringpublicMimeType(java.lang.String primary, java.lang.String sub) throwsMimeTypeParseException
primary
- the primary MIME typesub
- the MIME sub-typepublic java.lang.StringgetPrimaryType()
public voidsetPrimaryType(java.lang.String primary) throwsMimeTypeParseException
primary
- the primary MIME typepublic java.lang.StringgetSubType()
public voidsetSubType(java.lang.String sub) throwsMimeTypeParseException
sub
- the MIME sub-typepublicMimeTypeParameterListgetParameters()
public java.lang.StringgetParameter(java.lang.String name)
name
- the parameter namepublic voidsetParameter(java.lang.String name, java.lang.String value)
name
- the parameter namevalue
- the paramter's valuepublic voidremoveParameter(java.lang.String name)
name
- the parameter namepublic java.lang.StringtoString()
toString
in classjava.lang.Object
public java.lang.StringgetBaseType()
public booleanmatch(MimeType type)
type
- the MimeType object to compare withpublic booleanmatch(java.lang.String rawdata) throwsMimeTypeParseException
rawdata
- the MIME type string to compare withpublic voidwriteExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interfacejava.io.Externalizable
out
- the ObjectOutput object to write tojava.io.IOException
- Includes any I/O exceptions that may occurpublic voidreadExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interfacejava.io.Externalizable
in
- the IbjectInput object to read fromjava.lang.ClassNotFoundException
- If the class for an object being restored cannot be found.