org.modeshape.mimetype.aperture
Class ApertureMimeTypeDetector

java.lang.Object
  extended by org.modeshape.mimetype.aperture.ApertureMimeTypeDetector
All Implemented Interfaces:
MimeTypeDetector

public class ApertureMimeTypeDetector
extends Object
implements MimeTypeDetector

A MimeTypeDetector that uses the Aperture library.


Constructor Summary
ApertureMimeTypeDetector()
           
 
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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApertureMimeTypeDetector

public ApertureMimeTypeDetector()
Method Detail

mimeTypeOf

public 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.

Note that detector implementations should not close the supplied input stream.

Specified by:
mimeTypeOf in interface MimeTypeDetector
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
See Also:
MimeTypeDetector.mimeTypeOf(java.lang.String, java.io.InputStream)


Copyright © 2008-2010 JBoss, a division of Red Hat. All Rights Reserved.