Spec-Zone .ru
спецификации, руководства, описания, API
|
|
Java™ Platform Standard Ed. 7 DRAFT ea-b118 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.activation.MimeType
public class MimeType extends Object implements Externalizable
A Multipurpose Internet Mail Extension (MIME) type, as defined in RFC 2045 and 2046.
Constructor and Description |
---|
MimeType()
Default constructor. |
MimeType(String rawdata)
Constructor that builds a MimeType from a String. |
MimeType(String primary,
String sub)
Constructor that builds a MimeType with the given primary and sub type but has an empty parameter list. |
Modifier and Type | Method and Description |
---|---|
String |
getBaseType()
Return a String representation of this object without the parameter list. |
String |
getParameter(String name)
Retrieve the value associated with the given name, or null if there is no current association. |
MimeTypeParameterList |
getParameters()
Retrieve this object's parameter list. |
String |
getPrimaryType()
Retrieve the primary type of this object. |
String |
getSubType()
Retrieve the subtype of this object. |
boolean |
match(MimeType type)
Determine if the primary and sub type of this object is the same as what is in the given type. |
boolean |
match(String rawdata)
Determine if the primary and sub type of this object is the same as the content type described in rawdata. |
void |
readExternal(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. |
void |
removeParameter(String name)
Remove any value associated with the given name. |
void |
setParameter(String name,
String value)
Set the value to be associated with the given name, replacing any previous association. |
void |
setPrimaryType(String primary)
Set the primary type for this object to the given String. |
void |
setSubType(String sub)
Set the subtype for this object to the given String. |
String |
toString()
Return the String representation of this object. |
void |
writeExternal(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 |
Constructor Detail |
---|
public MimeType()
public MimeType(String rawdata) throws MimeTypeParseException
rawdata
- the MIME type stringMimeTypeParseException
public MimeType(String primary, String sub) throws MimeTypeParseException
primary
- the primary MIME typesub
- the MIME sub-typeMimeTypeParseException
- if the primary type or subtype
is not a valid tokenMethod Detail |
---|
public String getPrimaryType()
public void setPrimaryType(String primary) throws MimeTypeParseException
primary
- the primary MIME typeMimeTypeParseException
- if the primary type
is not a valid tokenpublic String getSubType()
public void setSubType(String sub) throws MimeTypeParseException
sub
- the MIME subtypeMimeTypeParseException
- if the subtype
is not a valid tokenpublic MimeTypeParameterList getParameters()
public String getParameter(String name)
name
- the parameter namepublic void setParameter(String name, String value)
name
- the parameter namevalue
- the paramter's valuepublic void removeParameter(String name)
name
- the parameter namepublic String toString()
toString
in class Object
public String getBaseType()
public boolean match(MimeType type)
type
- the MimeType object to compare withpublic boolean match(String rawdata) throws MimeTypeParseException
rawdata
- the MIME type string to compare withMimeTypeParseException
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
out
- the ObjectOutput object to write toIOException
- Includes any I/O exceptions that may occurpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
in
- the ObjectInput object to read fromClassNotFoundException
- If the class for an object being
restored cannot be found.IOException
- if I/O errors occur
|
Java™ Platform Standard Ed. 7 DRAFT ea-b118 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1993, 2010, Oracle Corporation. All rights reserved.