org.apache.any23.mime
Class NaiveMIMETypeDetector
java.lang.Object
org.apache.any23.mime.NaiveMIMETypeDetector
- All Implemented Interfaces:
- MIMETypeDetector
public class NaiveMIMETypeDetector
- extends Object
- implements MIMETypeDetector
Basic implementation of MIMETypeDetector based
on file extensions.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NaiveMIMETypeDetector
public NaiveMIMETypeDetector()
guessMIMEType
public MIMEType guessMIMEType(String fileName,
InputStream input,
MIMEType mimeTypeFromMetadata)
- Description copied from interface:
MIMETypeDetector
- Estimates the
MIME type of the content of input file.
- Specified by:
guessMIMEType in interface MIMETypeDetector
- Parameters:
fileName - name of the file.input - content of the file.mimeTypeFromMetadata - mimetype declared in metadata.
- Returns:
- the supposed mime type or
null if nothing appropriate found.
Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.