Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
javax.activation.MimeType
public class MimeType
extends java.lang.Object
implements Externalizable
Constructor Summary | |
| |
| |
|
Method Summary | |
String |
|
String |
|
MimeTypeParameterList |
|
String |
|
String |
|
boolean |
|
boolean | |
void |
|
void |
|
void |
|
void |
|
void |
|
String |
|
void |
|
public MimeType()
Constructor for anapplication/*
content type.
public MimeType(String rawdata) throws MimeTypeParseException
Constructor that parses a raw String.
- Parameters:
rawdata
- the MIME type string
public MimeType(String primary, String sub) throws MimeTypeParseException
Constructor for a new MIME type with the given primary and sub types and an empty parameter list.
- Parameters:
primary
- the primary typesub
- the subtype
public String getBaseType()
Returns the string representation of this MIME type without parameters.
public String getParameter(String name)
Returns the parameter value for the specified name.
- Parameters:
name
- the parameter name
public String getPrimaryType()
Returns the primary type.
public String getSubType()
Returns the subtype.
public boolean match(String rawdata) throws MimeTypeParseException
Returns true if the primary and subtype of this MIME type are the same as in the given MIME type string.
public boolean match(MimeType type)
Returns true if the primary and subtype of this MIME type are the same as in the given MIME type.
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
public void removeParameter(String name)
Removes the parameter value for the specified name.
- Parameters:
name
- the parameter name
public void setParameter(String name, String value)
Sets the parameter value for the specified name.
- Parameters:
name
- the parameter namevalue
- the new value
public void setPrimaryType(String primary) throws MimeTypeParseException
Sets the primary type.
- Parameters:
primary
- the new primary type
public void setSubType(String sub) throws MimeTypeParseException
Sets the subtype.
- Parameters:
sub
- the new subtype
public String toString()
Returns the complete string representation of this MIME type.
public void writeExternal(ObjectOutput out) throws IOException