Java version of Unix "file" utility?
Could someone point me toward a Java implementation of the file (1) utility? I need to examine uploaded files to make use they really are what their MIME type and extension say they are. Writing utility classes from scratch to read the magic number in the file header seems like reinventing the wheel.
thanks!
[322 byte] By [
IBMSUXa] at [2007-11-27 5:07:30]

This might be of some help (uses the javax.activation.MimetypesFileTypeMap). Don't think it reads the magic numbers though.
http://blog.seesaw.it/articles/2006/09/09/getting-mime-type-from-a-file
If you're just trying to launch the file, you could use the 1.6 Desktop API:
http://java.sun.com/javase/6/docs/api/java/awt/Desktop.html
Thanks for the replies, but it looks like I may have to write it from scratch. Sigh.The projects "Java Mime Magic Library" an Aperature on SF look promising, though.