Alternative to Files.probeContentType?

Take a look at the Apache Tika. It can easily determine a mime type:

 Tika tika = new Tika();
 File file = ...
 String mimeType = tika.detect(file);

Here’s a minimal required maven dependency:

 <dependency>
    <groupId>org.apache.tika</groupId>
    <artifactId>tika-core</artifactId>
    <version>1.12</version>
 </dependency>

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)