de.fu_berlin.ties.io
Class MimeTypeWithCharset

java.lang.Object
  extended byde.fu_berlin.ties.io.MimeTypeWithCharset

public final class MimeTypeWithCharset
extends Object

A simple wrapper for the MIME type and the character set of a document.

Version:
$Revision: 1.1 $, $Date: 2004/02/02 18:49:56 $, $Author: siefkes $
Author:
Christian Siefkes

Method Summary
static MimeTypeWithCharset determineMimeTypeWithCharset(String contentTypeHeader)
          Factory method that creates an instance from the information contained in the "Content-Type" header field of an URL.
 String getCharset()
          Returns the character set.
 String getMimeType()
          Returns the MIME type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

determineMimeTypeWithCharset

public static MimeTypeWithCharset determineMimeTypeWithCharset(String contentTypeHeader)
Factory method that creates an instance from the information contained in the "Content-Type" header field of an URL. The full list of MIME types is available at www.iana.org/assignments/media-types. If the explicit character set is specified, the default HTTP character set ("ISO-8859-1") is assumed.

Parameters:
contentTypeHeader - the "Content-Type" header of an URL, as returned by URLConnection.getContentType(); if null, the MIME type is set to null and the default HTTP charset is assumed
Returns:
the determined MIME type with charset

getCharset

public String getCharset()
Returns the character set.

Returns:
the character set

getMimeType

public String getMimeType()
Returns the MIME type.

Returns:
the MIME type, or null if the MIME type is unknown


Copyright © 2003-2004 Christian Siefkes. All Rights Reserved.