Package 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 ofMIMETypeDetector
based on file extensions.
-
-
Constructor Summary
Constructors Constructor Description NaiveMIMETypeDetector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MIMEType
guessMIMEType(String fileName, InputStream input, MIMEType mimeTypeFromMetadata)
Estimates theMIME
type of the content of input file.
-
-
-
Method Detail
-
guessMIMEType
public MIMEType guessMIMEType(String fileName, InputStream input, MIMEType mimeTypeFromMetadata)
Description copied from interface:MIMETypeDetector
Estimates theMIME
type of the content of input file.- Specified by:
guessMIMEType
in interfaceMIMETypeDetector
- 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.
-
-