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()
MimeTypeResolver
getName
in interface MimeTypeResolver
public int getPriority()
MimeTypeResolver
getPriority
in interface MimeTypeResolver
public 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 MimeTypeResolver
s. This is
desired so that any custom MimeTypeResolver
s that may override Tika's handling of a
mime type will be processed first.priority
- the prioritypublic boolean hasSchema()
MimeTypeResolver
hasSchema
in interface MimeTypeResolver
public String getSchema()
MimeTypeResolver
getSchema
in interface MimeTypeResolver
public String getFileExtensionForMimeType(String contentType)
MimeTypeResolver
getFileExtensionForMimeType
in interface MimeTypeResolver
contentType
- the mime typepublic String getMimeTypeForFileExtension(String fileExtension)
MimeTypeResolver
getMimeTypeForFileExtension
in interface MimeTypeResolver
fileExtension
- the file extension without the period in itThis work is licensed under a Creative Commons Attribution 4.0 International License.