public class MimeType extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,String> |
parameters
The parameters map.
|
protected String |
subtype
The subtype component
|
protected String |
type
The type component
|
| Constructor and Description |
|---|
MimeType(String raw) |
MimeType(String type,
String subType)
Constructor from type and subtype.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addParameter(String param,
String value)
Adds (and replaces if necessary) a parameter to this MIME type.
|
boolean |
equals(Object obj)
Two MIME Types are equal if their types and subtypes coincide.
|
String |
getParameterValue(String name)
Gets the value for a particular parameter.
|
String |
getSubtype()
Returns the subtype component of this MIME Type.
|
String |
getType()
Returns the type component of this MIME Type.
|
int |
hashCode()
The hashcode is composed (by addition) from the hashcodes for the type and
subtype.
|
boolean |
hasParameter(String name)
Checks to see if this MIME type has a particular parameter.
|
void |
setSubtype(String subtype)
Sets the subtype component of this MIME type.
|
void |
setType(String type)
Sets the type component of this MIME type.
|
String |
toString() |
protected String type
protected String subtype
public MimeType(String type, String subType)
type - subType - public MimeType(String raw) throws MimeTypeParseException
MimeTypeParseExceptionpublic boolean equals(Object obj)
public int hashCode()
public String getType()
public void setType(String type)
type - a String value.public String getSubtype()
public void setSubtype(String subtype)
subtype - a String value.public void addParameter(String param, String value)
param - the name of the parameter.value - the value of the parameter.public String getParameterValue(String name)
name - the name of the parameter.String value.public boolean hasParameter(String name)
name - the name of the parameter.Copyright © 2024 GATE. All rights reserved.