@ConsumerType public interface MimeTypeProviderThe
MimeTypeProviderinterface defines an API for services which are asked for MIME type mappings for unknown MIME types or extensions.
It is important to understand, that services registered with this interface are only called as a last resort and that the first service asked and replying with a non-
nullanswer wins. Specifically if a MIME type mapping is configured by default or as an extension to the MIME type service, MimeTypeProvider services are not queried.
This interface may be implemented by bundles wishing to provide control over how extensions are mapped to MIME types and vice-versa.
All Methods Instance Methods Abstract Methods Modifier and Type Method Description
getExtension(java.lang.String mimeType)Returns the primary name extension to which the given
getMimeType(java.lang.String name)Returns the MIME type of the extension of the given
java.lang.String getMimeType(java.lang.String name)Returns the MIME type of the extension of the given
name. The extension is the part of the name after the last dot. If the name does not contain a dot, the name as a whole is assumed to be the extension.
name- The name for which the MIME type is to be returned.
- The MIME type for the extension of the name. If the extension
cannot be mapped to a MIME type or
- See Also:
java.lang.String getExtension(java.lang.String mimeType)Returns the primary name extension to which the given
mimeTypemaps. The returned extension must map to the given
mimeTypewhen fed to the
getMimeType(String)method. In other words, the expression
mimeType.equals(getMimeType(getExtension(mimeType)))must always be
truefor any non-
A MIME type may be mapped to multiple extensions (e.g.
log, ...). This method is expected to returned one of those extensions. It is up to the implementation to select an appropriate extension if multiple mappings exist for a single MIME type.
mimeType- The MIME type whose primary extension is requested.
- A extension which maps to the given MIME type or
nullif no such mapping exists.
- See Also: