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