Package com.enonic.xp.util

## Class MediaTypes

- java.lang.Object
- - com.enonic.xp.util.MediaTypes

- All Implemented Interfaces:
    `MediaTypeService`, `Iterable<MediaTypeProvider>`

      @PublicApi
      public final class MediaTypes
      extends Object
      implements MediaTypeService

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addProvider​(MediaTypeProvider provider)` |
    `Map<String,​MediaType>` | `asMap()` |
    `MediaType` | `fromExt​(String ext)` |
    `MediaType` | `fromFile​(String fileName)` |
    `static MediaTypes` | `instance()` |
    `Iterator<MediaTypeProvider>` | `iterator()` |
    `void` | `removeProvider​(MediaTypeProvider provider)` |

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

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

    - ### Methods inherited from interface java.lang.Iterable

      `forEach, spliterator`

- - ### Method Detail

    - #### fromExt

          public MediaType fromExt​(String ext)

      Specified by:
        `fromExt` in interface `MediaTypeService`

    - #### fromFile

          public MediaType fromFile​(String fileName)

      Specified by:
        `fromFile` in interface `MediaTypeService`

    - #### asMap

          public Map<String,​MediaType> asMap()

      Specified by:
        `asMap` in interface `MediaTypeService`

    - #### addProvider

          public void addProvider​(MediaTypeProvider provider)

    - #### removeProvider

          public void removeProvider​(MediaTypeProvider provider)

    - #### iterator

          public Iterator<MediaTypeProvider> iterator()

      Specified by:
        `iterator` in interface `Iterable<MediaTypeProvider>`

    - #### instance

          public static MediaTypes instance()