Package org.opencms.loader
Class CmsMimeType
- java.lang.Object
-
- org.opencms.loader.CmsMimeType
-
- All Implemented Interfaces:
java.lang.Comparable<CmsMimeType>
public class CmsMimeType extends java.lang.Object implements java.lang.Comparable<CmsMimeType>
Describes a MIME type configured in OpenCms.- Since:
- 7.0.0
-
-
Constructor Summary
Constructors Constructor Description CmsMimeType(java.lang.String extension, java.lang.String type)
Default constructor for MIME types.CmsMimeType(java.lang.String extension, java.lang.String type, boolean configured)
Special constructor for "marked" MIME types.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(CmsMimeType obj)
MIME-types are compared according to the type first, and to the extension second.boolean
equals(java.lang.Object obj)
MIME-types are equal is the extension is equal.java.lang.String
getExtension()
Returns the MIME type file extension.java.lang.String
getType()
Returns the MIME type description.int
hashCode()
The hash code of MIME types is build only from the extension.boolean
isConfigured()
Returnstrue
if this MIME type has been read from the OpenCms configuration.
-
-
-
Constructor Detail
-
CmsMimeType
public CmsMimeType(java.lang.String extension, java.lang.String type)
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
public CmsMimeType(java.lang.String extension, java.lang.String type, boolean configured)
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 Detail
-
compareTo
public int compareTo(CmsMimeType obj)
MIME-types are compared according to the type first, and to the extension second.- Specified by:
compareTo
in interfacejava.lang.Comparable<CmsMimeType>
- See Also:
Comparable.compareTo(java.lang.Object)
-
equals
public boolean equals(java.lang.Object obj)
MIME-types are equal is the extension is equal.- Overrides:
equals
in classjava.lang.Object
- See Also:
Object.equals(java.lang.Object)
-
getExtension
public java.lang.String getExtension()
Returns the MIME type file extension.- Returns:
- the MIME type file extension
-
getType
public java.lang.String getType()
Returns the MIME type description.- Returns:
- the MIME type description
-
hashCode
public int hashCode()
The hash code of MIME types is build only from the extension.- Overrides:
hashCode
in classjava.lang.Object
- See Also:
Object.hashCode()
-
isConfigured
public boolean 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
-
-