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);
posted @ 2020-11-29 22:32  裸奔到月球  阅读(504)  评论(0编辑  收藏  举报