The question is published on by Tutorial Guruji team.
How do you get a Media Type (MIME type) from a file using Java? So far I’ve tried JMimeMagic & Mime-Util. The first gave me memory exceptions, the second doesn’t close its streams properly.
How would you probe the file to determine its actual type (not merely based on the extension)?
In Java 7 you can now just use