Jump to: navigation, search

Difference between revisions of "SMILA/Documentation/MimeTypeIdentifier"

(org.eclipse.smila.tika)
(org.eclipse.smila.tika)
Line 25: Line 25:
 
The bundle <tt>org.eclipse.smila.tika</tt> contains an implementation of the MimeTypeIdentifier service based on the [http://tika.apache.org/1.3/detection.html Detector services] provided by [http://tika.apache.org/Apache 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 [[http://tika.apache.org/1.3/detection.html Detector services Tika documentation].
 
The bundle <tt>org.eclipse.smila.tika</tt> contains an implementation of the MimeTypeIdentifier service based on the [http://tika.apache.org/1.3/detection.html Detector services] provided by [http://tika.apache.org/Apache 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 [[http://tika.apache.org/1.3/detection.html 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.
+
This service has a higher <tt>service.ranking</tt> property than the default implementation so it should be selected for service references if both bundles are started.
  
 
==== Configuration ====
 
==== Configuration ====
 
There are no configuration options available for this bundle.
 
There are no configuration options available for this bundle.

Revision as of 08:42, 31 January 2013

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 proeprty 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.