Given some source file (or more generic - input stream), I need to find out
It's an old thread, but I was doing this recently and found the Apache Tika library useful. Particularly for analysing generic streams to detect what content is in them.
Thought it might help others.
http://tika.apache.org/