public class MimeType extends Object implements Externalizable
| Constructor and Description | 
|---|
| MimeType()
              默认构造函数。 
             | 
| MimeType(String rawdata)
              从String构建MimeType的构造方法。 
             | 
| MimeType(String primary, String sub)
              构造函数,它使用给定的主类型和子类型构建MimeType,但具有空参数列表。 
             | 
| Modifier and Type | Method and Description | 
|---|---|
| String | getBaseType()
              返回此对象的String表示,而不包含参数列表。 
             | 
| String | getParameter(String name)
              检索与给定名称相关联的值,如果没有当前关联,则返回null。 
             | 
| MimeTypeParameterList | getParameters()
              检索此对象的参数列表。 
             | 
| String | getPrimaryType()
              检索此对象的主要类型。 
             | 
| String | getSubType()
              检索此对象的子类型。 
             | 
| boolean | match(MimeType type)
              确定此对象的主类型和子类型是否与给定类型中的相同。 
             | 
| boolean | match(String rawdata)
              确定此对象的主要类型和子类型是否与rawdata中描述的内容类型相同。 
             | 
| void | readExternal(ObjectInput in)
              该对象实现了readExternal方法来恢复其内容,方法是为对象,字符串和数组调用基本类型的DataInput方法和readObject。 
             | 
| void | removeParameter(String name)
              删除与给定名称相关联的任何值。 
             | 
| void | setParameter(String name, String value)
              设置与给定名称相关联的值,替换任何先前的关联。 
             | 
| void | setPrimaryType(String primary)
              将此对象的主要类型设置为给定的String。 
             | 
| void | setSubType(String sub)
              将此对象的子类型设置为给定的String。 
             | 
| String | toString()
              返回此对象的String表示。 
             | 
| void | writeExternal(ObjectOutput out)
              该对象实现了writeExternal方法来通过调用DataOutput的原始值或调用ObjectOutput对象,字符串和数组的writeObject方法来保存其内容。 
             | 
public MimeType()
public MimeType(String rawdata) throws MimeTypeParseException
rawdata - MIME类型字符串 
           MimeTypeParseException 
           public MimeType(String primary, String sub) throws MimeTypeParseException
primary - 主MIME类型 
           sub - MIME子类型 
           MimeTypeParseException - 如果主类型或子类型不是有效的标记 
           public String getPrimaryType()
public void setPrimaryType(String primary) throws MimeTypeParseException
primary - 主要MIME类型 
           MimeTypeParseException - 如果主类型不是有效的令牌 
           public String getSubType()
public void setSubType(String sub) throws MimeTypeParseException
sub - MIME子类型 
           MimeTypeParseException - 如果子类型不是有效的标记 
           public MimeTypeParameterList getParameters()
public String getParameter(String name)
name - 参数名称 
           public void setParameter(String name, String value)
name - 参数名称 
           value - 参数的价值 
           public void removeParameter(String name)
name - 参数名称 
           public String getBaseType()
public boolean match(MimeType type)
type - 要比较的MimeType对象 
           public boolean match(String rawdata) throws MimeTypeParseException
rawdata - 与之比较的MIME类型字符串 
           MimeTypeParseException 
           public void writeExternal(ObjectOutput out) throws IOException
writeExternal在界面 
            Externalizable 
           out - 要写入的ObjectOutput对象 
           IOException - 包括可能发生的任何I / O异常 
           public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal在界面 
            Externalizable 
           in - 要读取的ObjectInput对象 
           ClassNotFoundException - 如果无法找到正在还原的对象的类。 
           IOException - 如果发生I / O错误 
            Submit a bug or feature 
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.