public class TikaMimeTypeResolver extends Object implements MimeTypeResolver
MimeTypeResolver OSGi service that can map
a list of file extensions to their corresponding mime types, and vice versa.| Constructor and Description |
|---|
TikaMimeTypeResolver()
Constructs the Tika instance that will be used for mime type resolution.
|
| Modifier and Type | Method and Description |
|---|---|
void |
destroy() |
String |
getFileExtensionForMimeType(String contentType)
Gets the file extension for the specific mime type.
|
String |
getMimeTypeForFileExtension(String fileExtension)
Gets the mime type for the specified file extension.
|
String |
getName()
Gets the name of the MimeTypeResolver.
|
int |
getPriority()
Gets the priority of the MimeTypeResolver.
|
String |
getSchema()
Gets the schema (if one exists) of the MimeTypeResolver.
|
boolean |
hasSchema()
Returns true if the MimeTypeResolver has a schema, meaning it is for text/xml mime types and
has a namespace to match on.
|
void |
init() |
void |
setPriority(int priority)
Sets the priority of thie
MimeTypeResolver. |
public TikaMimeTypeResolver()
public void init()
public void destroy()
public String getName()
MimeTypeResolvergetName in interface MimeTypeResolverpublic int getPriority()
MimeTypeResolvergetPriority in interface MimeTypeResolverpublic void setPriority(int priority)
MimeTypeResolver. For the TikaMimeTypeResolver this priority
should usually be set (via blueprint) to a negative value to insure that this MimeTypeResolver is invoked last amongst all registered MimeTypeResolvers. This is
desired so that any custom MimeTypeResolvers that may override Tika's handling of a
mime type will be processed first.priority - the prioritypublic boolean hasSchema()
MimeTypeResolverhasSchema in interface MimeTypeResolverpublic String getSchema()
MimeTypeResolvergetSchema in interface MimeTypeResolverpublic String getFileExtensionForMimeType(String contentType)
MimeTypeResolvergetFileExtensionForMimeType in interface MimeTypeResolvercontentType - the mime typepublic String getMimeTypeForFileExtension(String fileExtension)
MimeTypeResolvergetMimeTypeForFileExtension in interface MimeTypeResolverfileExtension - the file extension without the period in itThis work is licensed under a Creative Commons Attribution 4.0 International License.