Package net.sf.okapi.common
Class MimeTypeMapper
- java.lang.Object
-
- net.sf.okapi.common.MimeTypeMapper
-
public final class MimeTypeMapper extends Object
Provides definitions for common MIME types and mappings from file extensions to MIME type.
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description MimeTypeMapper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetMimeType(String extension)Gets the mime type associated with the provided file extension.static booleanisSegmentationSupported(String mimeType)Returns true if Okapi supports segmentation for the format denoted by a given mimeType.
-
-
-
Field Detail
-
DEFAULT_MIME_TYPE
public static final String DEFAULT_MIME_TYPE
- See Also:
- Constant Field Values
-
XML_MIME_TYPE
public static final String XML_MIME_TYPE
- See Also:
- Constant Field Values
-
ODF_MIME_TYPE
public static final String ODF_MIME_TYPE
- See Also:
- Constant Field Values
-
HTML_MIME_TYPE
public static final String HTML_MIME_TYPE
- See Also:
- Constant Field Values
-
XHTML_MIME_TYPE
public static final String XHTML_MIME_TYPE
- See Also:
- Constant Field Values
-
PO_MIME_TYPE
public static final String PO_MIME_TYPE
- See Also:
- Constant Field Values
-
XLIFF_MIME_TYPE
public static final String XLIFF_MIME_TYPE
- See Also:
- Constant Field Values
-
XLIFF2_MIME_TYPE
public static final String XLIFF2_MIME_TYPE
- See Also:
- Constant Field Values
-
RTF_MIME_TYPE
public static final String RTF_MIME_TYPE
- See Also:
- Constant Field Values
-
MS_DOC_MIME_TYPE
public static final String MS_DOC_MIME_TYPE
- See Also:
- Constant Field Values
-
MS_EXCEL_MIME_TYPE
public static final String MS_EXCEL_MIME_TYPE
- See Also:
- Constant Field Values
-
MS_POWERPOINT_MIME_TYPE
public static final String MS_POWERPOINT_MIME_TYPE
- See Also:
- Constant Field Values
-
JAVASCRIPT_MIME_TYPE
public static final String JAVASCRIPT_MIME_TYPE
- See Also:
- Constant Field Values
-
CSV_MIME_TYPE
public static final String CSV_MIME_TYPE
- See Also:
- Constant Field Values
-
INDESIGN_MIME_TYPE
public static final String INDESIGN_MIME_TYPE
- See Also:
- Constant Field Values
-
MIF_MIME_TYPE
public static final String MIF_MIME_TYPE
- See Also:
- Constant Field Values
-
PLAIN_TEXT_MIME_TYPE
public static final String PLAIN_TEXT_MIME_TYPE
- See Also:
- Constant Field Values
-
QUARK_MIME_TYPE
public static final String QUARK_MIME_TYPE
- See Also:
- Constant Field Values
-
FLASH_MIME_TYPE
public static final String FLASH_MIME_TYPE
- See Also:
- Constant Field Values
-
PROPERTIES_MIME_TYPE
public static final String PROPERTIES_MIME_TYPE
- See Also:
- Constant Field Values
-
DTD_MIME_TYPE
public static final String DTD_MIME_TYPE
- See Also:
- Constant Field Values
-
SERVER_SIDE_INCLUDE_MIME_TYPE
public static final String SERVER_SIDE_INCLUDE_MIME_TYPE
- See Also:
- Constant Field Values
-
DOCX_MIME_TYPE
public static final String DOCX_MIME_TYPE
- See Also:
- Constant Field Values
-
DOCM_MIME_TYPE
public static final String DOCM_MIME_TYPE
- See Also:
- Constant Field Values
-
DOTX_MIME_TYPE
public static final String DOTX_MIME_TYPE
- See Also:
- Constant Field Values
-
DOTM_MIME_TYPE
public static final String DOTM_MIME_TYPE
- See Also:
- Constant Field Values
-
PPTX_MIME_TYPE
public static final String PPTX_MIME_TYPE
- See Also:
- Constant Field Values
-
PPTM_MIME_TYPE
public static final String PPTM_MIME_TYPE
- See Also:
- Constant Field Values
-
PPSX_MIME_TYPE
public static final String PPSX_MIME_TYPE
- See Also:
- Constant Field Values
-
PPSM_MIME_TYPE
public static final String PPSM_MIME_TYPE
- See Also:
- Constant Field Values
-
POTX_MIME_TYPE
public static final String POTX_MIME_TYPE
- See Also:
- Constant Field Values
-
POTM_MIME_TYPE
public static final String POTM_MIME_TYPE
- See Also:
- Constant Field Values
-
XLSX_MIME_TYPE
public static final String XLSX_MIME_TYPE
- See Also:
- Constant Field Values
-
XLSM_MIME_TYPE
public static final String XLSM_MIME_TYPE
- See Also:
- Constant Field Values
-
XLTX_MIME_TYPE
public static final String XLTX_MIME_TYPE
- See Also:
- Constant Field Values
-
XLTM_MIME_TYPE
public static final String XLTM_MIME_TYPE
- See Also:
- Constant Field Values
-
VSDX_MIME_TYPE
public static final String VSDX_MIME_TYPE
- See Also:
- Constant Field Values
-
VSDM_MIME_TYPE
public static final String VSDM_MIME_TYPE
- See Also:
- Constant Field Values
-
TS_MIME_TYPE
public static final String TS_MIME_TYPE
- See Also:
- Constant Field Values
-
PHP_MIME_TYPE
public static final String PHP_MIME_TYPE
- See Also:
- Constant Field Values
-
OPENOFFICE_MIME_TYPE
public static final String OPENOFFICE_MIME_TYPE
- See Also:
- Constant Field Values
-
TTX_MIME_TYPE
public static final String TTX_MIME_TYPE
- See Also:
- Constant Field Values
-
TMX_MIME_TYPE
public static final String TMX_MIME_TYPE
- See Also:
- Constant Field Values
-
XINI_MIME_TYPE
public static final String XINI_MIME_TYPE
- See Also:
- Constant Field Values
-
DOXYGEN_TXT_MIME_TYPE
public static final String DOXYGEN_TXT_MIME_TYPE
- See Also:
- Constant Field Values
-
TRANSIFEX
public static final String TRANSIFEX
- See Also:
- Constant Field Values
-
JSON_MIME_TYPE
public static final String JSON_MIME_TYPE
- See Also:
- Constant Field Values
-
TXML_MIME_TYPE
public static final String TXML_MIME_TYPE
- See Also:
- Constant Field Values
-
ICML_MIME_TYPE
public static final String ICML_MIME_TYPE
- See Also:
- Constant Field Values
-
YAML_MIME_TYPE
public static final String YAML_MIME_TYPE
- See Also:
- Constant Field Values
-
PDF_MIME_TYPE
public static final String PDF_MIME_TYPE
- See Also:
- Constant Field Values
-
MARKDOWN_MIME_TYPE
public static final String MARKDOWN_MIME_TYPE
- See Also:
- Constant Field Values
-
REGEX_MIME_TYPE
public static final String REGEX_MIME_TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getMimeType
public static String getMimeType(String extension)
Gets the mime type associated with the provided file extension. Some mime types map to many file extensions. Some file extensions map to many mime types. For example, there are many types of xml files which have different mime types.- Parameters:
extension- the file extension to lookup (without the dot prefix)- Returns:
- the mime type (UNKOWN_MIME_TYPE if the extension is not known).
-
isSegmentationSupported
public static boolean isSegmentationSupported(String mimeType)
Returns true if Okapi supports segmentation for the format denoted by a given mimeType. Segmentation support for Okapi means the filter for a given format inserts segment source and target placeholders in the resources created by the filter.- Parameters:
mimeType- the given mime type.- Returns:
- true if segmentation is supported for the given format.
-
-