hi deeplak ,
use this code to determine
String mimeType =Magic.getMagicMatch(file,false).getMimeType();
for this you have to use the jmime magic libraries which is available in the below link .
http://sourceforge.net/projects/jmimemagic/
if you dont want to user external jar you can use standard java
FileinputStream fileinptstrm = null ;
fileinptstrm =newBufferedInputStream(newFileInputStream(fileName));
String mimeType =URLConnection.guessContentTypeFromStream(fileinptstrm);
Regards
Govardan Raj