You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Bertrand Delacretaz <bd...@apache.org> on 2015/05/12 09:14:47 UTC

ContentAwareMimeTypeService, WDYT?

Hi,

FYI we're discussing adding a new bundle to provide content-based mime
type detection, in SLING-4694.

The idea is basically to create a new content-award mime type
detection bundle that provides the following service:

public interface ContentAwareMimeTypeService extends MimeTypeService {
/**
 * @param filename used as a fallback if the mime type cannot be detected from
 *   the supplied content, or if no content is supplied
 * @param optional stream that points to the content to analyze
 * @return the mime type
 */
String getMimeType(String filename, InputStream content) throws IOException;

If people have comments on this, now's the time!

-Bertrand