Skip navigation links

Package net.sf.mmm.util.contenttype.api

Provides the API for utilities that help to detect the type of content on the fly while streaming data.

See: Description

Package net.sf.mmm.util.contenttype.api Description

Provides the API for utilities that help to detect the type of content on the fly while streaming data.

Content-Type API

A common problem when dealing with arbitrary content is to detect the type of data and potentially additional metadata. This already starts with identifying a particular content type. Beside file extensions the most established approach is the mimetype. This API offers the interface ContentType for this purpose that identifies a content type as a node of a hierarchical tree. It also contains the mimetype and file extensions.
Often applications guess the type of content based on the extension of the filename. However, this causes imprecise or even wrong results and is sometimes NOT applicable because no filename is present. Another approach is to read the data and seek for characteristic patterns. This approach is done by the GNU linux program file.
This utility also detects the ContentType of arbitrary data by pattern based detection. However, it allows detection on the fly while streaming data. Further it can also extract additional metadata from the data (e.g. creator, quality information, or whatever is available for the actual content type). Finally, it is even possible to provide predefined metadata that is updated on the fly when the data is streamed (e.g. the artist can be specified and is added or updated while the stream is written to an output stream). This is implemented on the basis of the DetectorStream framework.
Skip navigation links

Copyright © 2001–2014 mmm-Team. All rights reserved.