Package org.silverpeas.components.gallery.constant

## Enum MediaMimeType

- java.lang.Object
- - java.lang.Enum<MediaMimeType>
  - - org.silverpeas.components.gallery.constant.MediaMimeType

- All Implemented Interfaces:
    `Serializable`, `Comparable<MediaMimeType>`

      public enum MediaMimeType
      extends Enum<MediaMimeType>

  Enumeration for all supported media types in the gallery component.

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant | Description
    --- | ---
    `BMP` |
    `ERROR` |
    `FLV` |
    `GIF` |
    `JPG` |
    `MOV` |
    `MP3` |
    `MP4` |
    `PNG` |
    `TIFF` |
    `WEBP` |

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static Set<MediaMimeType>` | `PHOTOS` |
    `static Set<MediaMimeType>` | `SOUNDS` |
    `static Set<MediaMimeType>` | `VIDEOS` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static MediaMimeType` | `fromFile​(File file)` | Finds from the given file the corresponding `MediaMimeType`
    `static MediaMimeType` | `fromMimeType​(String mimeType)` | Gets the corresponding `MediaMimeType` of specified one as string.
    `List<String>` | `getExtensions()` |
    `String` | `getMimeType()` |
    `String` | `getName()` |
    `static Set<MediaMimeType>` | `getSupportedMimeTypes​(MediaType mediaType)` | Gets the supported mime types according to the given media type.
    `boolean` | `isIPTCCompliant()` | Indicates if from the mime type can be read IPTC metadata.
    `boolean` | `isPreviewablePhoto()` | Indicates if the mime type is one of photo and if it is previewable.
    `boolean` | `isReadablePhoto()` | Indicates if the mime type is a photo one and if it is readable by ImageIo.
    `boolean` | `isSupportedMediaType()` | Indicates if the mime type is one of handled media types.
    `boolean` | `isSupportedPhotoType()` | Indicates if the mime type is one of handled photo types.
    `boolean` | `isSupportedSoundType()` | Indicates if the mime type is one of handled photo types.
    `boolean` | `isSupportedVideoType()` | Indicates if the mime type is one of handled photo types.
    `static MediaMimeType` | `valueOf​(String name)` | Returns the enum constant of this type with the specified name.
    `static MediaMimeType[]` | `values()` | Returns an array containing the constants of this enum type, in the order they are declared.

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

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

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

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### BMP

          public static final MediaMimeType BMP

    - #### GIF

          public static final MediaMimeType GIF

    - #### PNG

          public static final MediaMimeType PNG

    - #### JPG

          public static final MediaMimeType JPG

    - #### TIFF

          public static final MediaMimeType TIFF

    - #### WEBP

          public static final MediaMimeType WEBP

    - #### MOV

          public static final MediaMimeType MOV

    - #### MP4

          public static final MediaMimeType MP4

    - #### FLV

          public static final MediaMimeType FLV

    - #### MP3

          public static final MediaMimeType MP3

    - #### ERROR

          public static final MediaMimeType ERROR

  - ### Field Detail

    - #### PHOTOS

          public static final Set<MediaMimeType> PHOTOS

    - #### VIDEOS

          public static final Set<MediaMimeType> VIDEOS

    - #### SOUNDS

          public static final Set<MediaMimeType> SOUNDS

  - ### Method Detail

    - #### values

          public static MediaMimeType[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (MediaMimeType c : MediaMimeType.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static MediaMimeType valueOf​(String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
        `name` - the name of the enum constant to be returned.
      Returns:
        the enum constant with the specified name
      Throws:
        `IllegalArgumentException` - if this enum type has no constant with the specified name
        `NullPointerException` - if the argument is null

    - #### fromFile

          public static MediaMimeType fromFile​(File file)

      Finds from the given file the corresponding `MediaMimeType`
      Parameters:
        `file` - the file
      Returns:
        `MediaMimeType`

    - #### fromMimeType

          public static MediaMimeType fromMimeType​(String mimeType)

      Gets the corresponding `MediaMimeType` of specified one as string.
      Parameters:
        `mimeType` - the MIME type
      Returns:
        `MediaMimeType`

    - #### getName

          public String getName()

    - #### getMimeType

          public String getMimeType()

    - #### getExtensions

          public List<String> getExtensions()

    - #### isSupportedMediaType

          public boolean isSupportedMediaType()

      Indicates if the mime type is one of handled media types.
      Returns:
        true if it is a handled one, false otherwise.

    - #### isSupportedPhotoType

          public boolean isSupportedPhotoType()

      Indicates if the mime type is one of handled photo types.
      Returns:
        true if it is a handled one, false otherwise.

    - #### isSupportedVideoType

          public boolean isSupportedVideoType()

      Indicates if the mime type is one of handled photo types.
      Returns:
        true if it is a handled one, false otherwise.

    - #### isSupportedSoundType

          public boolean isSupportedSoundType()

      Indicates if the mime type is one of handled photo types.
      Returns:
        true if it is a handled one, false otherwise.

    - #### isReadablePhoto

          public boolean isReadablePhoto()

      Indicates if the mime type is a photo one and if it is readable by ImageIo.
      Returns:
        true if it is a photo media type that is readable by ImageIo

    - #### isPreviewablePhoto

          public boolean isPreviewablePhoto()

      Indicates if the mime type is one of photo and if it is previewable.
      Returns:
        true if the mime type is one of a photo and if it is previewable, false otherwise.

    - #### isIPTCCompliant

          public boolean isIPTCCompliant()

      Indicates if from the mime type can be read IPTC metadata.
      Returns:
        true if IPTC can be read, false otherwise.

    - #### getSupportedMimeTypes

          public static Set<MediaMimeType> getSupportedMimeTypes​(MediaType mediaType)

      Gets the supported mime types according to the given media type.
      Parameters:
        `mediaType` - the aimed media type.
      Returns:
        a set of media mime types.