It is possible to know the metadata of a file in java? and if it is, How to get the metadata of a file in java?
FITS is a command line app that bundles many tools that can identify and characterize files (extract metadata). It also has a java API
Also there are numerous identification and characterization tools that can do similar tasks. Apache Tika, Pronom Droid, Jhove, etc.