I know I can get this by doing this
String ext = FilenameUtils.getExtension("/path/to/file/foo.txt");
But what if someone tries to upload a foo.exe file by just changing the extension type to foo.doc. Is there any way through which I can get the actual extension type without reading the content of file