org.apache.nutch.util.mime
Class MimeType

java.lang.Object
  extended byorg.apache.nutch.util.mime.MimeType

public final class MimeType
extends Object

Defines a Mime Content Type.

Author:
Jerome Charron - http://frutch.free.fr/, Hari Kodungallur

Constructor Summary
MimeType(String name)
          Creates a MimeType from a String.
MimeType(String primary, String sub)
          Creates a MimeType with the given primary type and sub type.
 
Method Summary
 boolean equals(Object object)
          Indicates if an object is equal to this mime-type.
 String getName()
          Return the name of this mime-type.
 String getPrimaryType()
          Return the primary type of this mime-type.
 String getSubType()
          Return the sub type of this mime-type.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MimeType

public MimeType(String name)
         throws MimeTypeException
Creates a MimeType from a String.

Parameters:
name - the MIME content type String.

MimeType

public MimeType(String primary,
                String sub)
         throws MimeTypeException
Creates a MimeType with the given primary type and sub type.

Parameters:
primary - the content type primary type.
sub - the content type sub type.
Method Detail

getName

public String getName()
Return the name of this mime-type.

Returns:
the name of this mime-type.

getPrimaryType

public String getPrimaryType()
Return the primary type of this mime-type.

Returns:
the primary type of this mime-type.

getSubType

public String getSubType()
Return the sub type of this mime-type.

Returns:
the sub type of this mime-type.

toString

public String toString()

equals

public boolean equals(Object object)
Indicates if an object is equal to this mime-type. The specified object is equal to this mime-type if it is not null, and it is an instance of MimeType and its name is equals to this mime-type.

Parameters:
object - the reference object with which to compare.
Returns:
true if this mime-type is equal to the object argument; false otherwise.

hashCode

public int hashCode()


Copyright © 2006 The Apache Software Foundation