org.semanticdesktop.aperture.accessor.http
Class ContentType

java.lang.Object
  extended by org.semanticdesktop.aperture.accessor.http.ContentType

public class ContentType
extends Object

A utility class for working with mimeTypes and content type headers.


Field Summary
static String CHARSET_KEY
          The used with the parameters Map to obtain the charset
 
Constructor Summary
ContentType(String contentType)
          Creates a new ContentType object for the header field value.
 
Method Summary
 String getCharset()
          Returns the charset.
 String getMimeType()
          Returns the mime type
static String getMimeType(String contentType)
          Extracts the mime type from a content type header.
 String getParameter(String key)
          Returns the parameter with the given key
 Map getParameters()
          Returns a map of all 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
The used with the parameters Map to obtain the charset

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.

Parameters:
contentType - the contentType
Returns:
the mimeType

getMimeType

public String getMimeType()
Returns the mime type

Returns:
the mime type

getParameter

public String getParameter(String key)
Returns the parameter with the given key

Parameters:
key - the key
Returns:
the parameter with the given key

getParameters

public Map getParameters()
Returns a map of all parameters

Returns:
a map of all parameters

getCharset

public String getCharset()
Returns the charset.

Returns:
the charset


Copyright © 2010 Aperture Development Team. All Rights Reserved.