I want to find out file type of .properties file which is basically a text file. Using Apache tika and other mime type detectors prints out a .properties file as "text/plain" file as the magic number used for text file and .properties would be same.
I want to some how figure out a way to distinguish this based on special character or symbol inside a .properties file which is =
symbol or ascii value = chr(61) 00111101
between key/value pairs along with validation of .extension type.
So if I say to validate a file: If the file contains =
sign and .extension type is .properties then return out put as .properties file. I am not sure is this a good approach and also If I can achieve it, how would I add this other mime type detectors so that I can detect all other formats as well instead of having different custom classes.
Note: I tried adding custom type to apche tika which didn't work at all. May be some other library if you can suggest (example: MimeUtils)