hxt-9.2.2: A collection of tools for processing XML with Haskell.

Portability | portable
Stability | stable
Maintainer | Uwe Schmidt (uwe@fh-wedel.de)
Safe Haskell | Safe-Infered

Text.XML.HXT.Arrow.XmlState.MimeTypeTable

Description

the mime type configuration functions

Synopsis

- setMimeTypeTable :: MimeTypeTable -> IOStateArrow s b b
- setMimeTypeTableFromFile :: FilePath -> IOStateArrow s b b
- getMimeTypeTable :: IOStateArrow s b MimeTypeTable

# Documentation

setMimeTypeTable :: MimeTypeTable -> IOStateArrow s b b

set the table mapping of file extensions to mime types in the system state

Default table is defined in `MimeTypeDefaults`. This table is used when reading loacl files, (file: protocol) to determine the mime type

setMimeTypeTableFromFile :: FilePath -> IOStateArrow s b b

set the table mapping of file extensions to mime types by an external config file

The config file must follow the conventions of etcmime.types on a debian linux system, that means all empty lines and all lines starting with a # are ignored. The other lines must consist of a mime type followed by a possible empty list of extensions. The list of extenstions and mime types overwrites the default list in the system state of the IOStateArrow

getMimeTypeTable :: IOStateArrow s b MimeTypeTable

read the system mimetype table