Class DefaultMimeTypeManager

java.lang.Object
cloud.piranha.webapp.impl.DefaultMimeTypeManager
All Implemented Interfaces:
MimeTypeManager

public class DefaultMimeTypeManager
extends java.lang.Object
implements MimeTypeManager
The default MimeTypeManager.
Author:
Manfred Riem ([email protected])
  • Constructor Summary

    Constructors 
    Constructor Description
    DefaultMimeTypeManager()
    Constructor.
  • Method Summary

    Modifier and Type Method Description
    void addMimeType​(java.lang.String extension, java.lang.String mimeType)
    Add the mime type.
    java.lang.String getMimeType​(java.lang.String filename)
    Get the mime type.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • addMimeType

      public void addMimeType​(java.lang.String extension, java.lang.String mimeType)
      Add the mime type.
      Specified by:
      addMimeType in interface MimeTypeManager
      Parameters:
      extension - the extension (without the dot).
      mimeType - the mime type to return.
    • getMimeType

      public java.lang.String getMimeType​(java.lang.String filename)
      Get the mime type.
      Specified by:
      getMimeType in interface MimeTypeManager
      Parameters:
      filename - the filename.
      Returns:
      the mime type, or null if not found.