Determining binary/text file type in Java?

前端 未结 10 1140
心在旅途
心在旅途 2020-12-02 16:46

Namely, how would you tell an archive (jar/rar/etc.) file from a textual (xml/txt, encoding-independent) one?

10条回答
  •  日久生厌
    2020-12-02 17:22

    Have a look at the JMimeMagic library.

    jMimeMagic is a Java library for determining the MIME type of files or streams.

提交回复
热议问题