org.jboss.dna.graph.mimetype
Interface MimeTypeDetector
- All Known Implementing Classes:
- ApertureMimeTypeDetector
@ThreadSafe
public interface MimeTypeDetector
MIME-type detection libraries must provide thread-safe implementations of this interface to enable DNA to use the libraries to
return MIME-types for data sources.
- Author:
- jverhaeg
Method Summary |
String |
mimeTypeOf(String name,
InputStream content)
Returns the MIME-type of a data source, using its supplied content and/or its supplied name, depending upon the
implementation. |
mimeTypeOf
String mimeTypeOf(String name,
InputStream content)
throws IOException
- Returns the MIME-type of a data source, using its supplied content and/or its supplied name, depending upon the
implementation. If the MIME-type cannot be determined, either a "default" MIME-type or
null
may be returned,
where the former will prevent earlier registered MIME-type detectors from being consulted.
- Parameters:
name
- The name of the data source; may be null
.content
- The content of the data source; may be null
.
- Returns:
- The MIME-type of the data source, or optionally
null
if the MIME-type could not be determined.
- Throws:
IOException
- If an error occurs reading the supplied content.
Copyright © 2008-Present JBoss a division of Red Hat. All Rights Reserved.