|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.fu_berlin.ties.io.ContentType
public final class ContentType
A simple wrapper for the MIME type and the character set of a document.
Field Summary | |
---|---|
static String |
KEY_MIME_TYPE
Context key recommended to store the MIME type string. |
static String |
MIME_HTML
MIME type for HTML. |
static String |
MIME_PLAIN
MIME type for plain text. |
Method Summary | |
---|---|
static ContentType |
determineContentType(File file,
TiesConfiguration config)
Determines the content type based on a file name. |
static ContentType |
determineContentType(URL url,
String contentTypeHeader,
TiesConfiguration config)
Helper method to determines the content type based an "Content-Type" header and/or URL extension. |
String |
getCharset()
Returns the character set. |
String |
getMimeType()
Returns the MIME type. |
String |
toString()
Returns a string representation of this object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String KEY_MIME_TYPE
public static final String MIME_HTML
public static final String MIME_PLAIN
Method Detail |
---|
public static ContentType determineContentType(File file, TiesConfiguration config)
file
- the file nameconfig
- the configuration to use
public static ContentType determineContentType(URL url, String contentTypeHeader, TiesConfiguration config)
url
- the URL (might be null
)contentTypeHeader
- the "Content-Type" header of an URL, as returned
by URLConnection.getContentType()
(might be
null
)config
- the configuration to use
public String getCharset()
null
if unknownpublic String getMimeType()
null
if unknownpublic String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |