Package org.opencms.loader
Class CmsMimeType
java.lang.Object
org.opencms.loader.CmsMimeType
- All Implemented Interfaces:
Comparable<CmsMimeType>
Describes a MIME type configured in OpenCms.
- Since:
- 7.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionCmsMimeType
(String extension, String type) Default constructor for MIME types.CmsMimeType
(String extension, String type, boolean configured) Special constructor for "marked" MIME types. -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(CmsMimeType obj) MIME-types are compared according to the type first, and to the extension second.boolean
MIME-types are equal is the extension is equal.Returns the MIME type file extension.getType()
Returns the MIME type description.int
hashCode()
The hash code of MIME types is build only from the extension.boolean
Returnstrue
if this MIME type has been read from the OpenCms configuration.
-
Constructor Details
-
CmsMimeType
Default constructor for MIME types.If the extension does not start with a dot '.', then a dot is automatically added as a prefix.
- Parameters:
extension
- the MIME type extensiontype
- the MIME type description
-
CmsMimeType
Special constructor for "marked" MIME types.If the extension does not start with a dot '.', then a dot is automatically added as a prefix.
- Parameters:
extension
- the MIME type extensiontype
- the MIME type descriptionconfigured
- indicates if this a MIME type read from the OpenCms configuration
-
-
Method Details
-
compareTo
MIME-types are compared according to the type first, and to the extension second.- Specified by:
compareTo
in interfaceComparable<CmsMimeType>
- See Also:
-
equals
MIME-types are equal is the extension is equal. -
getExtension
Returns the MIME type file extension.- Returns:
- the MIME type file extension
-
getType
Returns the MIME type description.- Returns:
- the MIME type description
-
hashCode
The hash code of MIME types is build only from the extension. -
isConfigured
Returnstrue
if this MIME type has been read from the OpenCms configuration.- Returns:
true
if this MIME type has been read from the OpenCms configuration
-