Home » Open-JDK-6.b17-src » javax » activation » [javadoc | source]
javax.activation
public class: MimeType [javadoc | source]
java.lang.Object
   javax.activation.MimeType

All Implemented Interfaces:
    Externalizable

A Multipurpose Internet Mail Extension (MIME) type, as defined in RFC 2045 and 2046.
Constructor:
 public MimeType() 
 public MimeType(String rawdata) throws MimeTypeParseException 
    Constructor that builds a MimeType from a String.
    Parameters:
    rawdata - the MIME type string
 public MimeType(String primary,
    String sub) throws MimeTypeParseException 
    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
    Throws:
    MimeTypeParseException - if the primary type or subtype is not a valid token
    exception: MimeTypeParseException - if the primary type or subtype is not a valid token
Method from javax.activation.MimeType Summary:
getBaseType,   getParameter,   getParameters,   getPrimaryType,   getSubType,   match,   match,   readExternal,   removeParameter,   setParameter,   setPrimaryType,   setSubType,   toString,   writeExternal
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.activation.MimeType Detail:
 public String getBaseType() 
    Return a String representation of this object without the parameter list.
 public String getParameter(String name) 
    Retrieve the value associated with the given name, or null if there is no current association.
 public MimeTypeParameterList getParameters() 
    Retrieve this object's parameter list.
 public String getPrimaryType() 
    Retrieve the primary type of this object.
 public String getSubType() 
    Retrieve the subtype of this object.
 public boolean match(MimeType type) 
    Determine if the primary and sub type of this object is the same as what is in the given type.
 public boolean match(String rawdata) throws MimeTypeParseException 
    Determine if the primary and sub type of this object is the same as the content type described in rawdata.
 public  void readExternal(ObjectInput in) throws IOException, 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.
 public  void removeParameter(String name) 
    Remove any value associated with the given name.
 public  void setParameter(String name,
    String value) 
    Set the value to be associated with the given name, replacing any previous association.
 public  void setPrimaryType(String primary) throws MimeTypeParseException 
    Set the primary type for this object to the given String.
 public  void setSubType(String sub) throws MimeTypeParseException 
    Set the subtype for this object to the given String.
 public String toString() 
    Return the String representation of this object.
 public  void writeExternal(ObjectOutput out) throws 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.