|
Quaqua 5.4.1 2009-07-14 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.randelshofer.quaqua.datatransfer.MimeType
public class MimeType
A Multipurpose Internet Mail Extension (MIME) type, as defined in RFC 2045 and 2046.
Implementation taken from java.awt.datatransfer.MimeType 1.20 01/12/03
Constructor Summary | |
---|---|
MimeType()
Constructor for externalization; this constructor should not be called directly by an application, since the result will be an uninitialized, immutable MimeType object. |
|
MimeType(java.lang.String rawdata)
Builds a MimeType from a String . |
|
MimeType(java.lang.String primary,
java.lang.String sub)
Builds a MimeType with the given primary and sub
type but has an empty parameter list. |
|
MimeType(java.lang.String primary,
java.lang.String sub,
ch.randelshofer.quaqua.datatransfer.MimeTypeParameterList mtpl)
Builds a MimeType with a pre-defined
and valid (or empty) parameter list. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Returns a clone of this object. |
boolean |
equals(java.lang.Object thatObject)
MimeType s are equal if their primary types,
subtypes, and parameters are all equal. |
java.lang.String |
getBaseType()
Return a String representation of this object without the parameter list. |
java.lang.String |
getParameter(java.lang.String name)
Retrieve the value associated with the given name, or null if there is no current association. |
ch.randelshofer.quaqua.datatransfer.MimeTypeParameterList |
getParameters()
Retrieve a copy of this object's parameter list. |
java.lang.String |
getPrimaryType()
Retrieve the primary type of this object. |
java.lang.String |
getSubType()
Retrieve the sub type of this object. |
int |
hashCode()
|
boolean |
match(MimeType type)
Returns true if the primary type and the
subtype of this object are the same as the specified
type ; otherwise returns false . |
boolean |
match(java.lang.String rawdata)
Returns true if the primary type and the
subtype of this object are the same as the content type
described in rawdata ; otherwise returns
false . |
void |
readExternal(java.io.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(java.lang.String name)
Remove any value associated with the given name. |
void |
setParameter(java.lang.String name,
java.lang.String value)
Set the value to be associated with the given name, replacing any previous association. |
java.lang.String |
toString()
Return the String representation of this object. |
void |
writeExternal(java.io.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 |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MimeType()
MimeType
object.
public MimeType(java.lang.String rawdata) throws MimeTypeParseException
MimeType
from a String
.
rawdata
- text used to initialize the MimeType
MimeTypeParseException
public MimeType(java.lang.String primary, java.lang.String sub) throws MimeTypeParseException
MimeType
with the given primary and sub
type but has an empty parameter list.
primary
- the primary type of this MimeType
sub
- the subtype of this MimeType
MimeTypeParseException
public MimeType(java.lang.String primary, java.lang.String sub, ch.randelshofer.quaqua.datatransfer.MimeTypeParameterList mtpl) throws MimeTypeParseException
MimeType
with a pre-defined
and valid (or empty) parameter list.
primary
- the primary type of this MimeType
sub
- the subtype of this MimeType
mtpl
- the requested parameter list
MimeTypeParseException
Method Detail |
---|
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object thatObject)
MimeType
s are equal if their primary types,
subtypes, and parameters are all equal. No default values
are taken into account.
equals
in class java.lang.Object
thatObject
- the object to be evaluated as a
MimeType
true
if thatObject
is
a MimeType
; otherwise returns false
public java.lang.String getPrimaryType()
public java.lang.String getSubType()
public ch.randelshofer.quaqua.datatransfer.MimeTypeParameterList getParameters()
public java.lang.String getParameter(java.lang.String name)
public void setParameter(java.lang.String name, java.lang.String value)
java.lang.IllegalArgumentException
- if parameter or value is illegalpublic void removeParameter(java.lang.String name)
IllegalArgumentExcpetion
- if parameter may not be deletedpublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getBaseType()
public boolean match(MimeType type)
true
if the primary type and the
subtype of this object are the same as the specified
type
; otherwise returns false
.
type
- the type to compare to this
's type
true
if the primary type and the
subtype of this object are the same as the
specified type
; otherwise returns
false
public boolean match(java.lang.String rawdata) throws MimeTypeParseException
true
if the primary type and the
subtype of this object are the same as the content type
described in rawdata
; otherwise returns
false
.
rawdata
- the raw data to be examined
true
if the primary type and the
subtype of this object are the same as the content type
described in rawdata
; otherwise returns
false
; if rawdata
is
null
, returns false
MimeTypeParseException
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
- Includes any I/O exceptions that may occurpublic void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.lang.ClassNotFoundException
- If the class for an object being
restored cannot be found.
java.io.IOException
public java.lang.Object clone()
clone
in class java.lang.Object
|
Copyright 2003-2007 (c) Werner Randelshofer. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |