Class DLOpenerMimeTypes

java.lang.Object
com.liferay.document.library.opener.constants.DLOpenerMimeTypes

public class DLOpenerMimeTypes extends Object
Provides a set of constants and methods for working with the MIME types supported by Liferay. See https://developers.google.com/drive/api/v3/manage-downloads.
  • Field Details

    • APPLICATION_RTF

      public static final String APPLICATION_RTF
      The MIME type for Rich Text files.
      See Also:
    • APPLICATION_VND_DOCX

      public static final String APPLICATION_VND_DOCX
      The MIME type for Microsoft Word (docx) documents.
      See Also:
    • APPLICATION_VND_ODP

      public static final String APPLICATION_VND_ODP
      The MIME type for Open Document (odp) presentations.
      See Also:
    • APPLICATION_VND_ODS

      public static final String APPLICATION_VND_ODS
      The MIME type for Open Document (ods) spreadsheets.
      See Also:
    • APPLICATION_VND_ODT

      public static final String APPLICATION_VND_ODT
      The MIME type for Open Document (odt) documents.
      See Also:
    • APPLICATION_VND_PPTX

      public static final String APPLICATION_VND_PPTX
      The MIME type for Microsoft PowerPoint (pptx) presentations.
      See Also:
    • APPLICATION_VND_XLSX

      public static final String APPLICATION_VND_XLSX
      The MIME type for Microsoft Excel (xlsx) spreadsheets.
      See Also:
    • APPLICATION_VND_XSLX

      @Deprecated public static final String APPLICATION_VND_XSLX
      Deprecated.
      As of Mueller (7.2.x), replace by APPLICATION_VND_XLSX
      Misspelled MIME type for Microsoft Excel (xlsx) spreadsheets.
      See Also:
    • TEXT_TAB_SEPARATED_VALUES

      public static final String TEXT_TAB_SEPARATED_VALUES
      The MIME type for Tab Separated Values files.
      See Also:
    • extensions

      public static final Map<String,String> extensions
  • Constructor Details

    • DLOpenerMimeTypes

      public DLOpenerMimeTypes()
  • Method Details

    • getMimeTypeExtension

      public static String getMimeTypeExtension(String mimeType)
      Returns the canonical file extension associated with the MIME type. The canonical file extension is the most common one used for documents of this type (e.g., if the MIME type indicates this is a Microsoft docx document, the return value is ".docx".

      The return value always includes a dot (.) as the extension's first character.

      Parameters:
      mimeType - the MIME type
      Returns:
      the canonical extension, or an empty string if none could be determined