org.opencms.loader
Class CmsMimeType

java.lang.Object
  extended byorg.opencms.loader.CmsMimeType
All Implemented Interfaces:
java.lang.Comparable

public class CmsMimeType
extends java.lang.Object
implements java.lang.Comparable

Describes a MIME type configured in OpenCms.

Since:
7.0.0
Version:
$Revision: 1.2 $
Author:
Alexander Kandzior

Constructor Summary
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
 int compareTo(java.lang.Object 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()
          Returns true if this MIME type has been read from the OpenCms configuration.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

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 extension
type - 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 extension
type - the MIME type description
configured - indicates if this a MIME type read from the OpenCms configuration
Method Detail

compareTo

public int compareTo(java.lang.Object obj)
MIME-types are compared according to the type first, and to the extension second.

Specified by:
compareTo in interface java.lang.Comparable
See Also:
Comparable.compareTo(java.lang.Object)

equals

public boolean equals(java.lang.Object obj)
MIME-types are equal is the extension is equal.

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.

See Also:
Object.hashCode()

isConfigured

public boolean isConfigured()
Returns true if this MIME type has been read from the OpenCms configuration.

Returns:
true if this MIME type has been read from the OpenCms configuration