Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3


The purpose of this page is to discuss technical details relating to how a File Manager may obtain the mime type of a particular file that is about to be ingested when an automatic product detection Crawler is being used.

This article assumes that you have a working knowledge of the File Manager and the Crawler.

Components and Component Configuration

The components involved are the File Manager and the Crawler.

I'm ingesting hdf5 files (ext .h5) products into my archive.

The File Manager is setup and configured to ingest hdf5 files and knows about the expected metadata for the catalogue.

The Crawler is in "automatic product detection mode". This is setup by setting the CrawlerID to AutoDetectProductCrawler.

The Crawler policy/mimetypes.xml and policy/mime-extractor-map.xml files contains the information that is used by the Auto Detect Product Crawler to detect the file type by its regex name pattern so that it can run the correct metadata extractor. In my case I want to detect files that are named something like 1234567890.h5 and run an external extractor (actually some python code). The external extrator is configured in the katfile.config file. I've also set a precondition to make sure that the file size is greater than zero.

Code Block
	<mime-type type="product/hdf5">
		<glob pattern="\d{10}\.h5$" isregex="true"/>
Code Block
<cas:mimetypemap xmlns:cas="" magic="true or false" mimeRepo="/var/kat/katconfig/static/oodt/cas-crawler/policy/mimetypes.xml">
	<mime type="product/hdf5">
		<extractor class="org.apache.oodt.cas.metadata.extractors.ExternMetExtractor">
			<config file="/var/kat/katconfig/static/oodt/cas-extractors/katfile/katfile.config"/>
				<preCondComparator id="CheckThatDataFileSizeIsGreaterThanZero"/>

Process Steps

The Crawler extracts meta data from the product and produces a <name>.met file.

The Crawler then detects the mime type of the file is detected in the following line of code in The relevant code snippet is listed below. The mime-type is actually detected by the Tika library.

Code Block
        try {
            this.mimeType = mimeTypeRepository

                    .getMimeType(new URL(origRef));

        } catch (MalformedURLException e) {



The Crawler then executes an XML-RPC ingestProduct method call on the File Manager XML-RPC interface. I've captured the methodCall and here is the mime-type member that is passed to the File Manager on a successful ingest:

Code Block

For the auto detection product crawler, the product type is detected separately in two different places:

  • For metadata extraction, which is defined in the policy files.
  • By Tika to pass to the File Manager.

For my case the current version of Tika does not correctly identify *.h5 files, so it sets the mime-type to be application/octet-stream.

This issue will be resolved once JIRA has been completed.