org.eclipse.jetty.http

## Class MimeTypes

- java.lang.Object
- - org.eclipse.jetty.http.MimeTypes

-     public class MimeTypes
      extends Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static BufferCache` | `CACHE`
    `static String` | `FORM_ENCODED`
    `static BufferCache.CachedBuffer` | `FORM_ENCODED_BUFFER`
    `static String` | `MESSAGE_HTTP`
    `static BufferCache.CachedBuffer` | `MESSAGE_HTTP_BUFFER`
    `static String` | `MULTIPART_BYTERANGES`
    `static BufferCache.CachedBuffer` | `MULTIPART_BYTERANGES_BUFFER`
    `static String` | `TEXT_HTML`
    `static BufferCache.CachedBuffer` | `TEXT_HTML__8859_1_BUFFER`
    `static BufferCache.CachedBuffer` | `TEXT_HTML__UTF_8_BUFFER`
    `static String` | `TEXT_HTML_8859_1`
    `static BufferCache.CachedBuffer` | `TEXT_HTML_8859_1_BUFFER`
    `static BufferCache.CachedBuffer` | `TEXT_HTML_BUFFER`
    `static String` | `TEXT_HTML_UTF_8`
    `static BufferCache.CachedBuffer` | `TEXT_HTML_UTF_8_BUFFER`
    `static String` | `TEXT_JSON`
    `static BufferCache.CachedBuffer` | `TEXT_JSON__UTF_8_BUFFER`
    `static BufferCache.CachedBuffer` | `TEXT_JSON_BUFFER`
    `static String` | `TEXT_JSON_UTF_8`
    `static BufferCache.CachedBuffer` | `TEXT_JSON_UTF_8_BUFFER`
    `static String` | `TEXT_PLAIN`
    `static BufferCache.CachedBuffer` | `TEXT_PLAIN__8859_1_BUFFER`
    `static BufferCache.CachedBuffer` | `TEXT_PLAIN__UTF_8_BUFFER`
    `static String` | `TEXT_PLAIN_8859_1`
    `static BufferCache.CachedBuffer` | `TEXT_PLAIN_8859_1_BUFFER`
    `static BufferCache.CachedBuffer` | `TEXT_PLAIN_BUFFER`
    `static String` | `TEXT_PLAIN_UTF_8`
    `static BufferCache.CachedBuffer` | `TEXT_PLAIN_UTF_8_BUFFER`
    `static String` | `TEXT_XML`
    `static BufferCache.CachedBuffer` | `TEXT_XML__8859_1_BUFFER`
    `static BufferCache.CachedBuffer` | `TEXT_XML__UTF_8_BUFFER`
    `static String` | `TEXT_XML_8859_1`
    `static BufferCache.CachedBuffer` | `TEXT_XML_8859_1_BUFFER`
    `static BufferCache.CachedBuffer` | `TEXT_XML_BUFFER`
    `static String` | `TEXT_XML_UTF_8`
    `static BufferCache.CachedBuffer` | `TEXT_XML_UTF_8_BUFFER`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MimeTypes()` Constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addMimeMapping(String extension, String type)` Set a mime mapping
    `static String` | `getCharsetFromContentType(Buffer value)`
    `Buffer` | `getMimeByExtension(String filename)` Get the MIME type by filename extension.
    `Map` | `getMimeMap()`
    `void` | `setMimeMap(Map mimeMap)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### FORM_ENCODED

          public static final String FORM_ENCODED

      See Also:
        Constant Field Values

    - #### MESSAGE_HTTP

          public static final String MESSAGE_HTTP

      See Also:
        Constant Field Values

    - #### MULTIPART_BYTERANGES

          public static final String MULTIPART_BYTERANGES

      See Also:
        Constant Field Values

    - #### TEXT_HTML

          public static final String TEXT_HTML

      See Also:
        Constant Field Values

    - #### TEXT_PLAIN

          public static final String TEXT_PLAIN

      See Also:
        Constant Field Values

    - #### TEXT_XML

          public static final String TEXT_XML

      See Also:
        Constant Field Values

    - #### TEXT_JSON

          public static final String TEXT_JSON

      See Also:
        Constant Field Values

    - #### TEXT_HTML_8859_1

          public static final String TEXT_HTML_8859_1

      See Also:
        Constant Field Values

    - #### TEXT_PLAIN_8859_1

          public static final String TEXT_PLAIN_8859_1

      See Also:
        Constant Field Values

    - #### TEXT_XML_8859_1

          public static final String TEXT_XML_8859_1

      See Also:
        Constant Field Values

    - #### TEXT_HTML_UTF_8

          public static final String TEXT_HTML_UTF_8

      See Also:
        Constant Field Values

    - #### TEXT_PLAIN_UTF_8

          public static final String TEXT_PLAIN_UTF_8

      See Also:
        Constant Field Values

    - #### TEXT_XML_UTF_8

          public static final String TEXT_XML_UTF_8

      See Also:
        Constant Field Values

    - #### TEXT_JSON_UTF_8

          public static final String TEXT_JSON_UTF_8

      See Also:
        Constant Field Values

    - #### CACHE

          public static final BufferCache CACHE

    - #### FORM_ENCODED_BUFFER

          public static final BufferCache.CachedBuffer FORM_ENCODED_BUFFER

    - #### MESSAGE_HTTP_BUFFER

          public static final BufferCache.CachedBuffer MESSAGE_HTTP_BUFFER

    - #### MULTIPART_BYTERANGES_BUFFER

          public static final BufferCache.CachedBuffer MULTIPART_BYTERANGES_BUFFER

    - #### TEXT_HTML_BUFFER

          public static final BufferCache.CachedBuffer TEXT_HTML_BUFFER

    - #### TEXT_PLAIN_BUFFER

          public static final BufferCache.CachedBuffer TEXT_PLAIN_BUFFER

    - #### TEXT_XML_BUFFER

          public static final BufferCache.CachedBuffer TEXT_XML_BUFFER

    - #### TEXT_JSON_BUFFER

          public static final BufferCache.CachedBuffer TEXT_JSON_BUFFER

    - #### TEXT_HTML_8859_1_BUFFER

          public static final BufferCache.CachedBuffer TEXT_HTML_8859_1_BUFFER

    - #### TEXT_PLAIN_8859_1_BUFFER

          public static final BufferCache.CachedBuffer TEXT_PLAIN_8859_1_BUFFER

    - #### TEXT_XML_8859_1_BUFFER

          public static final BufferCache.CachedBuffer TEXT_XML_8859_1_BUFFER

    - #### TEXT_HTML_UTF_8_BUFFER

          public static final BufferCache.CachedBuffer TEXT_HTML_UTF_8_BUFFER

    - #### TEXT_PLAIN_UTF_8_BUFFER

          public static final BufferCache.CachedBuffer TEXT_PLAIN_UTF_8_BUFFER

    - #### TEXT_XML_UTF_8_BUFFER

          public static final BufferCache.CachedBuffer TEXT_XML_UTF_8_BUFFER

    - #### TEXT_JSON_UTF_8_BUFFER

          public static final BufferCache.CachedBuffer TEXT_JSON_UTF_8_BUFFER

    - #### TEXT_HTML__8859_1_BUFFER

          public static final BufferCache.CachedBuffer TEXT_HTML__8859_1_BUFFER

    - #### TEXT_PLAIN__8859_1_BUFFER

          public static final BufferCache.CachedBuffer TEXT_PLAIN__8859_1_BUFFER

    - #### TEXT_XML__8859_1_BUFFER

          public static final BufferCache.CachedBuffer TEXT_XML__8859_1_BUFFER

    - #### TEXT_HTML__UTF_8_BUFFER

          public static final BufferCache.CachedBuffer TEXT_HTML__UTF_8_BUFFER

    - #### TEXT_PLAIN__UTF_8_BUFFER

          public static final BufferCache.CachedBuffer TEXT_PLAIN__UTF_8_BUFFER

    - #### TEXT_XML__UTF_8_BUFFER

          public static final BufferCache.CachedBuffer TEXT_XML__UTF_8_BUFFER

    - #### TEXT_JSON__UTF_8_BUFFER

          public static final BufferCache.CachedBuffer TEXT_JSON__UTF_8_BUFFER

  - ### Constructor Detail

    - #### MimeTypes

          public MimeTypes()

      Constructor.

  - ### Method Detail

    - #### getMimeMap

          public Map getMimeMap()

    - #### setMimeMap

          public void setMimeMap(Map mimeMap)

      Parameters:
        `mimeMap` - A Map of file extension to mime-type.

    - #### getMimeByExtension

          public Buffer getMimeByExtension(String filename)

      Get the MIME type by filename extension.
      Parameters:
        `filename` - A file name
      Returns:
        MIME type matching the longest dot extension of the file name.

    - #### addMimeMapping

          public void addMimeMapping(String extension,
                            String type)

      Set a mime mapping
      Parameters:
        `extension` -
        `type` -

    - #### getCharsetFromContentType

          public static String getCharsetFromContentType(Buffer value)

Copyright © 1995-2015 Mort Bay Consulting. All Rights Reserved.