public interface ContentAwareMimeTypeService extends MimeTypeService
ContentAwareMimeTypeService
interface extends the
MimeTypeService
API for services
which can detect mime types based on the content passed to them.
The implementing services should rely on analyzing the content to ascertain the mime type. This interface may be implemented by bundles wishing to provide a mechanism to detect mime type based on the contents.
Modifier and Type | Method and Description |
---|---|
String |
getMimeType(String filename,
InputStream contentStream) |
getExtension, getExtensionMap, getMimeMap, getMimeType, registerMimeType, registerMimeType
String getMimeType(String filename, InputStream contentStream) throws IOException, IllegalArgumentException
filename
- Used if content
is null
or if
this service does not support content-based detectioncontentStream
- Optional stream that points to the content to analyze,
must support mark/reset.IllegalArgumentException
- if contentStream does not support mark/resetIOException
- if there's a problem reading the contentStreamCopyright © 2010 - 2020 Adobe. All Rights Reserved