org.apache.tika.config
Class TikaConfig

java.lang.Object
  extended by org.apache.tika.config.TikaConfig

public class TikaConfig
extends java.lang.Object

Parse xml config file.


Constructor Summary
TikaConfig()
          Creates a Tika configuration from the built-in media type rules and all the Parser implementations available through the service provider mechanism in the context class loader of the current thread.
TikaConfig(java.lang.ClassLoader loader)
          Creates a Tika configuration from the built-in media type rules and all the Parser implementations available through the service provider mechanism in the given class loader.
TikaConfig(org.w3c.dom.Document document)
           
TikaConfig(org.w3c.dom.Document document, Parser delegate)
          Deprecated. This method will be removed in Apache Tika 1.0
TikaConfig(org.w3c.dom.Element element)
           
TikaConfig(org.w3c.dom.Element element, Parser delegate)
          Deprecated. This method will be removed in Apache Tika 1.0
TikaConfig(java.io.File file)
           
TikaConfig(java.io.InputStream stream)
           
TikaConfig(java.io.InputStream stream, Parser delegate)
          Deprecated. This method will be removed in Apache Tika 1.0
TikaConfig(java.lang.String file)
           
TikaConfig(java.net.URL url)
           
 
Method Summary
static TikaConfig getDefaultConfig()
          Provides a default configuration (TikaConfig).
static TikaConfig getDefaultConfig(Parser delegate)
          Deprecated. This method will be removed in Apache Tika 1.0
 MediaTypeRegistry getMediaTypeRegistry()
           
 MimeTypes getMimeRepository()
           
 Parser getParser()
          Returns the configured parser instance.
 Parser getParser(MediaType mimeType)
          Deprecated. Use the getParser() method instead
 java.util.Map<MediaType,Parser> getParsers()
          Deprecated. Use the getParser() method instead
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TikaConfig

public TikaConfig(java.lang.String file)
           throws TikaException,
                  java.io.IOException,
                  org.xml.sax.SAXException
Throws:
TikaException
java.io.IOException
org.xml.sax.SAXException

TikaConfig

public TikaConfig(java.io.File file)
           throws TikaException,
                  java.io.IOException,
                  org.xml.sax.SAXException
Throws:
TikaException
java.io.IOException
org.xml.sax.SAXException

TikaConfig

public TikaConfig(java.net.URL url)
           throws TikaException,
                  java.io.IOException,
                  org.xml.sax.SAXException
Throws:
TikaException
java.io.IOException
org.xml.sax.SAXException

TikaConfig

public TikaConfig(java.io.InputStream stream)
           throws TikaException,
                  java.io.IOException,
                  org.xml.sax.SAXException
Throws:
TikaException
java.io.IOException
org.xml.sax.SAXException

TikaConfig

public TikaConfig(java.io.InputStream stream,
                  Parser delegate)
           throws TikaException,
                  java.io.IOException,
                  org.xml.sax.SAXException
Deprecated. This method will be removed in Apache Tika 1.0

Throws:
TikaException
java.io.IOException
org.xml.sax.SAXException
See Also:
TIKA-275

TikaConfig

public TikaConfig(org.w3c.dom.Document document)
           throws TikaException,
                  java.io.IOException
Throws:
TikaException
java.io.IOException

TikaConfig

public TikaConfig(org.w3c.dom.Document document,
                  Parser delegate)
           throws TikaException,
                  java.io.IOException
Deprecated. This method will be removed in Apache Tika 1.0

Throws:
TikaException
java.io.IOException
See Also:
TIKA-275

TikaConfig

public TikaConfig(org.w3c.dom.Element element)
           throws TikaException,
                  java.io.IOException
Throws:
TikaException
java.io.IOException

TikaConfig

public TikaConfig(java.lang.ClassLoader loader)
           throws MimeTypeException,
                  java.io.IOException
Creates a Tika configuration from the built-in media type rules and all the Parser implementations available through the service provider mechanism in the given class loader.

Parameters:
loader - the class loader through which parser implementations are loaded, or null for no parsers
Throws:
MimeTypeException - if the built-in media type rules are broken
java.io.IOException - if the built-in media type rules can not be read
Since:
Apache Tika 0.8

TikaConfig

public TikaConfig()
           throws MimeTypeException,
                  java.io.IOException
Creates a Tika configuration from the built-in media type rules and all the Parser implementations available through the service provider mechanism in the context class loader of the current thread.

Throws:
MimeTypeException - if the built-in media type rules are broken
java.io.IOException - if the built-in media type rules can not be read

TikaConfig

public TikaConfig(org.w3c.dom.Element element,
                  Parser delegate)
           throws TikaException,
                  java.io.IOException
Deprecated. This method will be removed in Apache Tika 1.0

Throws:
TikaException
java.io.IOException
See Also:
TIKA-275
Method Detail

getParser

public Parser getParser(MediaType mimeType)
Deprecated. Use the getParser() method instead


getParser

public Parser getParser()
Returns the configured parser instance.

Returns:
configured parser

getParsers

public java.util.Map<MediaType,Parser> getParsers()
Deprecated. Use the getParser() method instead


getMimeRepository

public MimeTypes getMimeRepository()

getMediaTypeRegistry

public MediaTypeRegistry getMediaTypeRegistry()

getDefaultConfig

public static TikaConfig getDefaultConfig()
Provides a default configuration (TikaConfig). Currently creates a new instance each time it's called; we may be able to have it return a shared instance once it is completely immutable.

Returns:
default configuration

getDefaultConfig

public static TikaConfig getDefaultConfig(Parser delegate)
                                   throws TikaException
Deprecated. This method will be removed in Apache Tika 1.0

Throws:
TikaException
See Also:
TIKA-275


Copyright © 2007-2010 The Apache Software Foundation. All Rights Reserved.