remove reflection code; use Java 7 API directly for filetype detection

This PR only cleans up the file-type detection. Includes no feature or bugfix.