Files.probeContentType的替代

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

ika tika = new Tika();
 File file = ...
 String mimeType = tika.detect(file);
原文地址:https://www.cnblogs.com/leiqun123/p/14058555.html