TikaDetector { public org.springframework.http.MediaType detect(final InputStream inputStream, final String fileName) throws IOException { final TikaInputStream stream = TikaInputStream.get(inputStream); return detect(stream, fileName); } private  TikaDetector(); static TikaDetector tikaDetector(); org.springframework.http.MediaType detect(final InputStream inputStream, final String fileName);  }
@Test public void testDetect() throws Exception { final InputStream inputStream = loadFileIntoInputStream(FILE_PATH); final MediaType mediaType = TikaDetector.tikaDetector().detect(inputStream, FILE_NAME); assertions.assertThat(mediaType).isEqualTo(MediaType.IMAGE_JPEG); }