Search This Blog

Java: library to detect file mime types

1. Mime Type Detection Utility: Enable Java programs to detect MIME types based on file extensions, magic data and content sniffing. Supports detection from java.io.File, java.io.InputStream, java.net.URL and byte arrays. 


2.jMimeMagic is a Java library for determining the MIME type of files or streams.
  • Check out the source code from github:
    git clone https://github.com/arimus/jmimemagic.git
    
  • To build jMimeMagic, you need to have maven installed. Then run maven to build it:
    mvn clean package
    
  • The built jar will be placed into ./target
  • jMimeMagic Java API Docs 

See Also

No comments:

Post a Comment