public class ContentAwareMimeTypeServiceImpl extends Object implements ContentAwareMimeTypeService
| Constructor and Description |
|---|
ContentAwareMimeTypeServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
String |
getExtension(String mimeType) |
String |
getMimeType(String name) |
String |
getMimeType(String filename,
InputStream content) |
void |
registerMimeType(InputStream mimeTabStream) |
void |
registerMimeType(String mimeType,
String... extensions) |
public String getMimeType(String filename, InputStream content) throws IOException, IllegalArgumentException
getMimeType in interface ContentAwareMimeTypeServicefilename - Used if content is null or if
this service does not support content-based detectioncontent - Optional stream that points to the content to analyze,
must support mark/reset.IOException - if there's a problem reading the contentStreamIllegalArgumentException - if contentStream does not support mark/resetpublic String getMimeType(String name)
getMimeType in interface org.apache.sling.commons.mime.MimeTypeServicepublic String getExtension(String mimeType)
getExtension in interface org.apache.sling.commons.mime.MimeTypeServicepublic void registerMimeType(String mimeType, String... extensions)
registerMimeType in interface org.apache.sling.commons.mime.MimeTypeServicepublic void registerMimeType(InputStream mimeTabStream) throws IOException
registerMimeType in interface org.apache.sling.commons.mime.MimeTypeServiceIOExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.