org.apache.tika.mime
Class MimeTypesFactory

java.lang.Object
  extended by org.apache.tika.mime.MimeTypesFactory

public class MimeTypesFactory
extends java.lang.Object

Creates instances of MimeTypes.


Constructor Summary
MimeTypesFactory()
           
 
Method Summary
static MimeTypes create()
          Creates an empty instance; same as calling new MimeTypes().
static MimeTypes create(org.w3c.dom.Document document)
          Creates and returns a MimeTypes instance from the specified document.
static MimeTypes create(java.io.InputStream inputStream)
          Creates and returns a MimeTypes instance from the specified input stream.
static MimeTypes create(java.lang.String filePath)
          Creates and returns a MimeTypes instance from the specified file path, as interpreted by the class loader in getResource().
static MimeTypes create(java.net.URL url)
          Creates and returns a MimeTypes instance from the resource at the location specified by the URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MimeTypesFactory

public MimeTypesFactory()
Method Detail

create

public static MimeTypes create()
Creates an empty instance; same as calling new MimeTypes().

Returns:
an empty instance

create

public static MimeTypes create(org.w3c.dom.Document document)
                        throws MimeTypeException
Creates and returns a MimeTypes instance from the specified document.

Throws:
MimeTypeException - if the type configuration is invalid

create

public static MimeTypes create(java.io.InputStream inputStream)
                        throws java.io.IOException,
                               MimeTypeException
Creates and returns a MimeTypes instance from the specified input stream. Does not close the input stream.

Throws:
java.io.IOException - if the stream can not be read
MimeTypeException - if the type configuration is invalid

create

public static MimeTypes create(java.net.URL url)
                        throws java.io.IOException,
                               MimeTypeException
Creates and returns a MimeTypes instance from the resource at the location specified by the URL. Opens and closes the InputStream from the URL.

Throws:
java.io.IOException - if the URL can not be accessed
MimeTypeException - if the type configuration is invalid

create

public static MimeTypes create(java.lang.String filePath)
                        throws java.io.IOException,
                               MimeTypeException
Creates and returns a MimeTypes instance from the specified file path, as interpreted by the class loader in getResource().

Throws:
java.io.IOException - if the file can not be accessed
MimeTypeException - if the type configuration is invalid


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