Enum Class MediaMimeType

java.lang.Object
java.lang.Enum<MediaMimeType>
org.silverpeas.components.gallery.constant.MediaMimeType
All Implemented Interfaces:
Serializable, Comparable<MediaMimeType>, Constable

public enum MediaMimeType extends Enum<MediaMimeType>
Enumeration for all supported media types in the gallery component.
  • Enum Constant Details

  • Field Details

  • Method Details

    • values

      public static MediaMimeType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static MediaMimeType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class 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
      See Also:
    • 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.