|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.activation.MimeType
public class MimeType
A MIME content type, as defined in RFCs 2045 and 2046.
Constructor Summary | |
---|---|
MimeType()
Constructor for an application/* content type. |
|
MimeType(java.lang.String rawdata)
Constructor that parses a raw String. |
|
MimeType(java.lang.String primary,
java.lang.String sub)
Constructor for a new MIME type with the given primary and sub types and an empty parameter list. |
Method Summary | |
---|---|
static void |
checkValidity(java.lang.String token,
java.lang.String message)
|
java.lang.String |
getBaseType()
Returns the string representation of this MIME type without parameters. |
java.lang.String |
getParameter(java.lang.String name)
Returns the parameter value for the specified name. |
MimeTypeParameterList |
getParameters()
Returns the MIME parameters. |
java.lang.String |
getPrimaryType()
Returns the primary type. |
java.lang.String |
getSubType()
Returns the subtype. |
static boolean |
isValidChar(char c)
|
boolean |
match(MimeType type)
Returns true if the primary and subtype of this MIME type are the same as in the given MIME type. |
boolean |
match(java.lang.String rawdata)
Returns true if the primary and subtype of this MIME type are the same as in the given MIME type string. |
void |
readExternal(java.io.ObjectInput in)
|
void |
removeParameter(java.lang.String name)
Removes the parameter value for the specified name. |
void |
setParameter(java.lang.String name,
java.lang.String value)
Sets the parameter value for the specified name. |
void |
setPrimaryType(java.lang.String primary)
Sets the primary type. |
void |
setSubType(java.lang.String sub)
Sets the subtype. |
java.lang.String |
toString()
Returns the complete string representation of this MIME type. |
void |
writeExternal(java.io.ObjectOutput out)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MimeType()
application/*
content type.
public MimeType(java.lang.String rawdata) throws MimeTypeParseException
rawdata
- the MIME type string
MimeTypeParseException
public MimeType(java.lang.String primary, java.lang.String sub) throws MimeTypeParseException
primary
- the primary typesub
- the subtype
MimeTypeParseException
Method Detail |
---|
public java.lang.String getPrimaryType()
public void setPrimaryType(java.lang.String primary) throws MimeTypeParseException
primary
- the new primary type
MimeTypeParseException
public java.lang.String getSubType()
public void setSubType(java.lang.String sub) throws MimeTypeParseException
sub
- the new subtype
MimeTypeParseException
public MimeTypeParameterList getParameters()
public java.lang.String getParameter(java.lang.String name)
name
- the parameter namepublic void setParameter(java.lang.String name, java.lang.String value)
name
- the parameter namevalue
- the new valuepublic void removeParameter(java.lang.String name)
name
- the parameter namepublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getBaseType()
public boolean match(MimeType type)
public boolean match(java.lang.String rawdata) throws MimeTypeParseException
MimeTypeParseException
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
public static void checkValidity(java.lang.String token, java.lang.String message) throws MimeTypeParseException
MimeTypeParseException
public static boolean isValidChar(char c)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |