How to find the type of the file? I am writing a code to find that file on unix system is image file or not?
Possibilities exists that someone has changed the extension.
Thanks in advance.
How to find the type of the file? I am writing a code to find that file on unix system is image file or not?
Possibilities exists that someone has changed the extension.
Thanks in advance.
Java 7 has Files.probeContentType(Path path)
which probes the content type of a file. See API for details.