Documentation API of the 'org.clapper.util.misc.MIMETypeUtil' Java class

Class MIMETypeUtil

  • public class MIMETypeUtilextends Object
    The MIMETypeUtil class provides some general purpose MIME type utilities not found in the JDK. Among other methods, this class provides the fileExtensionForMIMEType() method, which converts a MIME type to a file extension. That method uses a traditional mime.types files, similar to the file shipped with with web servers such as Apache. It looks for a suitable file in the following locations:
    1. First, it looks for the file .mime.types in the user's home directory.
    2. Next, it looks for mime.types (no leading ".") in all the directories in the CLASSPATH
    3. Last, it loads a default set of mappings shipped with this library

    It loads all the matching files it finds; the first mapping found for a given MIME type is the one that is used. The files are only loaded once within a given running Java VM.

    The syntax of the file follows the classic mime.types syntax:

     # The format is <mime type> <space separated file extensions> # Comments begin with a '#' text/plain             txt text TXT text/html              html htm HTML HTM ... 

    When mapping a MIME type to an extension, fileExtensionForMIMEType() uses the first extension it finds in the mime.types file. MIME types that cannot be found in the file are mapped to extension ".dat".

Warning: You cannot see the full API documentation of this class since the access to the DatMelt documentation for third-party Java classes is denied. Guests can only view jhplot Java API. To view the complete description of this class and its methods, please request the full DataMelt membership.

If you are already a full member, please login to the DataMelt member area before visiting this documentation.