public interface MimeTypeMapper
MimeTypeResolvers to retieve file extension for
a given mime type, and vice versa.| Modifier and Type | Method and Description |
|---|---|
String |
getFileExtensionForMimeType(String contentType)
Retrieves the file extension for the specified mime type, e.g., returns ".nitf" for a mime type
of "image/nitf".
|
String |
getMimeTypeForFileExtension(String fileExtension)
Retrieves the mime type for the specified file extension, e.g., returns "image/nitf" for a file
extension of "nitf".
|
String |
guessMimeType(InputStream is,
String fileExtension)
Attempts to guess the mime type for the specified file extension by introspecting the supplied
InputStream if necessary.
|
String getFileExtensionForMimeType(String contentType) throws MimeTypeResolutionException
contentType - the mime typeMimeTypeException - if any problems encountered during mime type mappingMimeTypeResolutionExceptionString getMimeTypeForFileExtension(String fileExtension) throws MimeTypeResolutionException
fileExtension - the file extension to look up the mime type forMimeTypeException - if any problems encountered during mime type mappingMimeTypeResolutionExceptionString guessMimeType(InputStream is, String fileExtension) throws MimeTypeResolutionException
is - InputStream for the @File associated with the file extensionfileExtension - the file extension to look up the mime type forMimeTypeResolutionException - if any problems encountered during mime type mappingThis work is licensed under a Creative Commons Attribution 4.0 International License.