Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

SMILA/Documentation/MimeTypeIdentifier

Overview

A MimeTypeIdentifier is an OSGi service which can be used to identify the MIME type of a given byte[], InputStream or a file extension. The documentation of a pipelet which uses this service can be found at SMILA/Documentation/Bundle_org.eclipse.smila.processing.pipelets .

API

You can find the javaDoc API for the MimeTypeIdentifier here

Implementations

It is possible to provide different implementations for the MimeTypeIdentifier interface. In general it makes sense to only activate one MimeTypeIdentifier implementation at the same time. This is achieved by simply starting just the bundle with the desired implementation. If multiple implementations are started, a client using the MimeTypeIdentifier has to use a filter to select between the available implementations. Otherwise it gets a reference randomly (or based on the service.ranking property of the service registrations). The component name could be used for filtering.

Below is a list of the currently available implementations.

org.eclipse.smila.common.mimetype.impl

The default implementation SimpleMimeTypeIdentifier cam only identify MIME types (only) by file extension. Identification by byte[] or InputStream is not supported. The mapping file mime.types (located inside the bundle) is used to map from file extension to MIME type.

Configuration

There are no configuration options available for this bundle.

org.eclipse.smila.tika

Idea.png
This implementation is not yet available in SMILA. We have to finish the CQ process for Apache Tika and its dependencies first


The bundle org.eclipse.smila.tika contains an implementation of the MimeTypeIdentifier service based on the Detector services provided by Tika. The default detector service started by Tika uses magic bytes as well as filename (i.e. filename suffix) based detection. For details see the Detector services Tika documentation.

This service has a higher service.ranking property than the default implementation so it should be selected for service references if both bundles are started.

Configuration

There are no configuration options available for this bundle.

Back to the top