org.apache.jetspeed.util
Class MimeType

java.lang.Object
  extended by org.apache.jetspeed.util.MimeType

public class MimeType
extends Object

Utility class for declaring MIME types to use for various requests and provide utility manipulation methods.

Added Content-Encoding capability, with defaults

Version:
$Id: MimeType.java 516448 2007-03-09 16:25:47Z ate $
Author:
Raphaël Luta, Santiago Gala

Field Summary
private  String charSet
          null value means default encoding.
static MimeType HTML
           
private  String mimeType
          Standard ContentType String, with no encoding appended.
static MimeType VXML
           
static MimeType WML
           
static MimeType XHTML
           
static MimeType XML
           
 
Constructor Summary
MimeType(String mimeType)
           
MimeType(String mimeType, String charSet)
           
 
Method Summary
 boolean equals(Object obj)
          Compare one MimeType to another
 String getCharSet()
          Return the character encoding associated, if any
 String getCode()
          Extracts from this MimeType a user-friendly identifying code ie "html" for "text/html" or "wml" for "text/vnd.wap.wml"
 String getContentType()
          Return the media type associated
 String toString()
          Convert this MimeType to its external String representation
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

HTML

public static final MimeType HTML

XHTML

public static final MimeType XHTML

WML

public static final MimeType WML

XML

public static final MimeType XML

VXML

public static final MimeType VXML

mimeType

private String mimeType
Standard ContentType String, with no encoding appended.


charSet

private String charSet
null value means default encoding. Otherwise, charset to be used.

Constructor Detail

MimeType

public MimeType(String mimeType)

MimeType

public MimeType(String mimeType,
                String charSet)
Method Detail

getCode

public String getCode()
Extracts from this MimeType a user-friendly identifying code ie "html" for "text/html" or "wml" for "text/vnd.wap.wml"

Returns:
the simplified type

getContentType

public String getContentType()
Return the media type associated


getCharSet

public String getCharSet()
Return the character encoding associated, if any


toString

public String toString()
Convert this MimeType to its external String representation

Overrides:
toString in class Object

equals

public boolean equals(Object obj)
Compare one MimeType to another

Overrides:
equals in class Object


Copyright © 1999-2007 Apache Software Foundation. All Rights Reserved.