info.aduna.net
Class ContentType

java.lang.Object
  extended by info.aduna.net.ContentType

public class ContentType
extends Object

A ContentType consists of a mime-type, a character encoding and an optional set of parameters.

Author:
Herko ter Horst

Field Summary
static String CHARSET_KEY
           
 
Constructor Summary
ContentType(String contentType)
          Creates a new ContentType object for the header field value.
 
Method Summary
 String getCharset()
          Get the character encoding
 String getMimeType()
          Get the mime-type.
static String getMimeType(String contentType)
          Extracts the MIME type from a content type header.
 String getParameter(String key)
          Get the parameter value for the specified key
 Map<String,String> getParameters()
          Get the parameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHARSET_KEY

public static final String CHARSET_KEY
See Also:
Constant Field Values
Constructor Detail

ContentType

public ContentType(String contentType)
Creates a new ContentType object for the header field value.

Parameters:
contentType - A Content-Type header field value.
Method Detail

getMimeType

public static String getMimeType(String contentType)
Extracts the MIME type from a content type header.


getMimeType

public String getMimeType()
Get the mime-type.

Returns:
the mime-type

getParameter

public String getParameter(String key)
Get the parameter value for the specified key

Parameters:
key - the key to look up
Returns:
the paramater value for the specified key, or null if there is no value for the specified key

getParameters

public Map<String,String> getParameters()
Get the parameters

Returns:
the parameters

getCharset

public String getCharset()
Get the character encoding

Returns:
the character encoding


Copyright © 1997-2008 Aduna. All Rights Reserved.