Package org.apache.tika.mime
Class MimeTypesFactory
java.lang.Object
org.apache.tika.mime.MimeTypesFactory
Deprecated.
This version of the Apache Tika library is deprecated. Use your own version of Apache Tika.
Creates instances of MimeTypes.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDeprecated.System property to set a path to an additional external custom mimetypes XML file to be loaded. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MimeTypescreate()Deprecated.Creates an empty instance; same as calling new MimeTypes().static MimeTypescreate(InputStream stream) Deprecated.static MimeTypescreate(InputStream... inputStreams) Deprecated.Creates and returns a MimeTypes instance from the specified input stream.static MimeTypesDeprecated.Creates and returns a MimeTypes instance from the specified file path, as interpreted by the class loader in getResource().static MimeTypesDeprecated.Creates and returns a MimeTypes instance.static MimeTypescreate(String coreFilePath, String extensionFilePath, ClassLoader classLoader) Deprecated.Creates and returns a MimeTypes instance.static MimeTypesDeprecated.static MimeTypesDeprecated.Creates and returns a MimeTypes instance from the resource at the location specified by the URL.static MimeTypesDeprecated.Creates and returns a MimeTypes instance from the specified document.
-
Field Details
-
CUSTOM_MIMES_SYS_PROP
Deprecated.System property to set a path to an additional external custom mimetypes XML file to be loaded.- See Also:
-
-
Constructor Details
-
MimeTypesFactory
public MimeTypesFactory()Deprecated.
-
-
Method Details
-
create
Deprecated.Creates an empty instance; same as calling new MimeTypes().- Returns:
- an empty instance
-
create
Deprecated.Creates and returns a MimeTypes instance from the specified document.- Throws:
MimeTypeException- if the type configuration is invalid
-
create
Deprecated.Creates and returns a MimeTypes instance from the specified input stream. Does not close the input stream(s).- Throws:
IOException- if the stream can not be readMimeTypeException- if the type configuration is invalid
-
create
Deprecated.- Throws:
IOExceptionMimeTypeException- See Also:
-
create
Deprecated.Creates and returns a MimeTypes instance from the resource at the location specified by the URL. Opens and closes the InputStream from the URL. If multiple URLs are supplied, then they are loaded in turn.- Throws:
IOException- if the URL can not be accessedMimeTypeException- if the type configuration is invalid
-
create
Deprecated.- Throws:
IOExceptionMimeTypeException- See Also:
-
create
Deprecated.Creates and returns a MimeTypes instance from the specified file path, as interpreted by the class loader in getResource().- Throws:
IOException- if the file can not be accessedMimeTypeException- if the type configuration is invalid
-
create
public static MimeTypes create(String coreFilePath, String extensionFilePath) throws IOException, MimeTypeException Deprecated.Creates and returns a MimeTypes instance. The core mimetypes will be loaded from the specified file path, and any custom override mimetypes found will loaded afterwards. The file paths will be interpreted by the default class loader in getResource().- Parameters:
coreFilePath- The main MimeTypes file to loadextensionFilePath- The name of extension MimeType files to load afterwards- Throws:
IOException- if the file can not be accessedMimeTypeException- if the type configuration is invalid
-
create
public static MimeTypes create(String coreFilePath, String extensionFilePath, ClassLoader classLoader) throws IOException, MimeTypeException Deprecated.Creates and returns a MimeTypes instance. The core mimetypes will be loaded from the specified file path, and any custom override mimetypes found will loaded afterwards. The file paths will be interpreted by the specified class loader in getResource(). It will also load custom mimetypes from the system propertyCUSTOM_MIMES_SYS_PROP, if specified.- Parameters:
coreFilePath- The main MimeTypes file to loadextensionFilePath- The name of extension MimeType files to load afterwards- Throws:
IOException- if the file can not be accessedMimeTypeException- if the type configuration is invalid
-