Package io.wcm.handler.media
Enum MediaFileType
- java.lang.Object
-
- java.lang.Enum<MediaFileType>
-
- io.wcm.handler.media.MediaFileType
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<MediaFileType>
@ProviderType public enum MediaFileType extends java.lang.Enum<MediaFileType>
File types supported by Media Handler.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static @NotNull java.util.Set<java.lang.String>
getBrowserImageContentTypes()
static @NotNull java.util.Set<java.lang.String>
getBrowserImageFileExtensions()
static @Nullable MediaFileType
getByContentType(@Nullable java.lang.String contentType)
Get Media file type by content type.static @Nullable MediaFileType
getByFileExtensions(@Nullable java.lang.String extension)
Get Media file type by file extension.java.util.Set<java.lang.String>
getContentTypes()
java.util.Set<java.lang.String>
getExtensions()
static @NotNull java.util.Set<java.lang.String>
getImageContentTypes()
static @NotNull java.util.Set<java.lang.String>
getImageFileExtensions()
static @NotNull java.util.Set<java.lang.String>
getVectorImageContentTypes()
static @NotNull java.util.Set<java.lang.String>
getVectorImageFileExtensions()
static boolean
isBrowserImage(@Nullable java.lang.String fileExtension)
Check if the given file extension is supported for direct display in a browser.static boolean
isImage(@Nullable java.lang.String fileExtension)
Check if the given file extension is supported by the Media Handler for rendering as image.boolean
isImageQualityPercentage()
static boolean
isVectorImage(@Nullable java.lang.String fileExtension)
Check if the given file extension is a vector image file extension.static MediaFileType
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static MediaFileType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
JPEG
public static final MediaFileType JPEG
JPEG
-
PNG
public static final MediaFileType PNG
PNG
-
GIF
public static final MediaFileType GIF
GIF
-
TIFF
public static final MediaFileType TIFF
TIFF
-
SVG
public static final MediaFileType SVG
SVG
-
-
Method Detail
-
values
public static MediaFileType[] 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 (MediaFileType c : MediaFileType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static MediaFileType valueOf(java.lang.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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getContentTypes
public java.util.Set<java.lang.String> getContentTypes()
- Returns:
- Content types
-
getExtensions
public java.util.Set<java.lang.String> getExtensions()
- Returns:
- File extensions
-
isImageQualityPercentage
public boolean isImageQualityPercentage()
- Returns:
- true if this image type has lossy compression and image quality is specified in percentage
-
isImage
public static boolean isImage(@Nullable @Nullable java.lang.String fileExtension)
Check if the given file extension is supported by the Media Handler for rendering as image.- Parameters:
fileExtension
- File extension- Returns:
- true if image
-
getImageFileExtensions
@NotNull public static @NotNull java.util.Set<java.lang.String> getImageFileExtensions()
- Returns:
- Image file extensions supported by the Media Handler for rendering as image.
-
getImageContentTypes
@NotNull public static @NotNull java.util.Set<java.lang.String> getImageContentTypes()
- Returns:
- Image content types supported by the Media Handler for rendering as image.
-
isBrowserImage
public static boolean isBrowserImage(@Nullable @Nullable java.lang.String fileExtension)
Check if the given file extension is supported for direct display in a browser.- Parameters:
fileExtension
- File extension- Returns:
- true if image is supported in browsers
-
getBrowserImageFileExtensions
@NotNull public static @NotNull java.util.Set<java.lang.String> getBrowserImageFileExtensions()
- Returns:
- Image file extensions supported for direct display in a browser.
-
getBrowserImageContentTypes
@NotNull public static @NotNull java.util.Set<java.lang.String> getBrowserImageContentTypes()
- Returns:
- Image content types supported for direct display in a browser.
-
isVectorImage
public static boolean isVectorImage(@Nullable @Nullable java.lang.String fileExtension)
Check if the given file extension is a vector image file extension.- Parameters:
fileExtension
- File extension- Returns:
- true if image is a vector image.
-
getVectorImageFileExtensions
@NotNull public static @NotNull java.util.Set<java.lang.String> getVectorImageFileExtensions()
- Returns:
- Image file extensions that are vector images.
-
getVectorImageContentTypes
@NotNull public static @NotNull java.util.Set<java.lang.String> getVectorImageContentTypes()
- Returns:
- Image content types that are vector images.
-
getByContentType
@Nullable public static @Nullable MediaFileType getByContentType(@Nullable @Nullable java.lang.String contentType)
Get Media file type by content type.- Parameters:
contentType
- Content type- Returns:
- Media file type or null if not found
-
getByFileExtensions
@Nullable public static @Nullable MediaFileType getByFileExtensions(@Nullable @Nullable java.lang.String extension)
Get Media file type by file extension.- Parameters:
extension
- File extension- Returns:
- Media file type or null if not found
-
-