title: Java ProbeContentType
body: <p>How does Probe Content Type in java work?</p>
  
  <p>Some <a href="http://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileTypeDetector.html" rel="nofollow noreferrer">resources</a> highlight that it is based on file extension and other resources such as <a href="https://stackoverflow.com/questions/12407479/why-does-files-probecontenttype-return-null">this one</a> indicate that a bug exists.</p>
  
  <p>I've created a excel file and using <strong>save as</strong> I've saved it as <strong>myexcelfile.txt</strong> and ProbeContentType reported it as <strong>application/zip</strong> hence proving that it is not based on extension, now this has created further confusion as <a href="http://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileTypeDetector.html" rel="nofollow noreferrer">the link</a> I've provided is from Oracle and states both extension wise and byte wise verification.</p>
  
  <p>What is the fact? How does ProbeContentType actually work?</p>