- All Implemented Interfaces:
Serializable
,Comparable<ContentType>
Only a specific set of content types are supported by the CDN.
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ContentType
getContentTypeForExtension
(String extension) Gets the content type from its extension, case-sensitive.static ContentType
getContentTypeForMimeType
(String mimeType) Gets the content type from its content type, case-insensitive, matching up to first ';', and trimmed.abstract String
Each content type is represented by a distinct file extension.abstract String
Gets the distinct MIME content type.static ContentType
Returns the enum constant of this type with the specified name.static ContentType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
JPEG
-
PNG
-
GIF
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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 nameNullPointerException
- if the argument is null
-
getMimeType
Gets the distinct MIME content type. This is used provided in headers when the resource is requested.No corresponding method exists for getting character encoding, since the CDN is only storing binary files.
-
getExtension
Each content type is represented by a distinct file extension. This is used internally in the filesystem and externally in the URL. -
getContentTypeForExtension
public static ContentType getContentTypeForExtension(String extension) throws IllegalArgumentException, NullPointerException Gets the content type from its extension, case-sensitive.- Throws:
IllegalArgumentException
- when no content type has the given extensionNullPointerException
- when extension is null- See Also:
-
getContentTypeForMimeType
public static ContentType getContentTypeForMimeType(String mimeType) throws IllegalArgumentException, NullPointerException Gets the content type from its content type, case-insensitive, matching up to first ';', and trimmed.- Throws:
IllegalArgumentException
- when no content type has the given content typeNullPointerException
- when content type is null- See Also:
-