org.apache.tomcat.util.http

Class ContentType

public class ContentType extends Object

Usefull methods for Content-Type processing

Author: James Duncan Davidson [duncan@eng.sun.com] James Todd [gonzo@eng.sun.com] Jason Hunter [jch@eng.sun.com] Harish Prabandham costin@eng.sun.com

Method Summary
static StringgetCharsetFromContentType(String contentType)
Parse the character encoding from the specified content type header.
static booleanhasCharset(String type)
Returns true if the given content type contains a charset component, false otherwise.

Method Detail

getCharsetFromContentType

public static String getCharsetFromContentType(String contentType)
Parse the character encoding from the specified content type header. If the content type is null, or there is no explicit character encoding, null is returned.

Parameters: contentType a content type header

hasCharset

public static boolean hasCharset(String type)
Returns true if the given content type contains a charset component, false otherwise.

Parameters: type Content type

Returns: true if the given content type contains a charset component, false otherwise

Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.