com.silverpeas.gallery.constant
Enum MediaMimeType

java.lang.Object
  extended by java.lang.Enum<MediaMimeType>
      extended by com.silverpeas.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
BMP
           
ERROR
           
FLV
           
GIF
           
JPG
           
MOV
           
MP3
           
MP4
           
PNG
           
TIFF
           
 
Field Summary
static Set<MediaMimeType> PHOTOS
           
static Set<MediaMimeType> SOUNDS
           
static Set<MediaMimeType> VIDEOS
           
 
Method Summary
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()
          Gets supported extensions.
 String getMimeType()
          Gets the mime type as string.
 String getName()
          Gets the name (useful for JSTL use)
 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 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

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 -
Returns:
MediaMimeType

fromMimeType

public static MediaMimeType fromMimeType(String mimeType)
Gets the corresponding MediaMimeType of specified one as string.

Parameters:
mimeType -
Returns:
MediaMimeType

getName

public String getName()
Gets the name (useful for JSTL use)

Returns:

getMimeType

public String getMimeType()
Gets the mime type as string.

Returns:

getExtensions

public List<String> getExtensions()
Gets supported extensions.

Returns:

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:
http://docs.oracle.com/javase/6/docs/api/javax/imageio/package-summary.html

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.


Copyright © 2016 Silverpeas. All Rights Reserved.