Package it.ozimov.springboot.mail.utils
Class TikaDetector
java.lang.Object
it.ozimov.springboot.mail.utils.TikaDetector
A convenience singleton class that uses ApacheTika to guess the MIME type.
-
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.MediaTypedetect(InputStream inputStream, String fileName) Detect the MediaType of the given input streamstatic TikaDetector
-
Method Details
-
tikaDetector
-
detect
public org.springframework.http.MediaType detect(InputStream inputStream, String fileName) throws IOException Detect the MediaType of the given input stream- Parameters:
inputStream- the stream for which the content has to be detectedfileName- filename with extension- Returns:
- the guessed media type
- Throws:
IOException
-