java library to find the mime type from file content [duplicate]
问题 This question already has answers here : Getting A File's Mime Type In Java (21 answers) Closed 6 years ago . I am searching for a java library which tells you the mime type by looking at the file content(byte array). I found this project using jmimemagic and it no longer supports newer file types (eg. MS word docx format) as it is inactive now (from 2006). 回答1: Maybe useful for someone, who needs the most used office formats as well (and does not use Apache Tika): public class MimeTypeUtils