title: Getting MimeType subtype with Apache tika
body: <p>I'd need to get the iana.org MediaType  rather than  application/zip or application/x-tika-msoffice for documents like, odt, ppt, pptx, xlsx etc.</p>
  
  <p>If you look at mimetypes.xml there are mimeType elements composed of the iana.org mime-type and "sub-class-of"</p>
  
  <pre><code>   &lt;mime-type type="application/msword"&gt;
      &lt;alias type="application/vnd.ms-word"/&gt;
      ............................
      &lt;glob pattern="*.doc"/&gt;
      &lt;glob pattern="*.dot"/&gt;
      &lt;sub-class-of type="application/x-tika-msoffice"/&gt;
    &lt;/mime-type&gt;
  </code></pre>
  
  <p>How to get the iana.org mime-type name instead of the parent type name ?</p>
  
  <p>When testing mime type detection, I do :</p>
  
  <pre><code>MediaType mediaType = MediaType.parse(tika.detect(inputStream));
  String mimeType = mediaType.getSubtype();
  </code></pre>
  
  <p>Test Results :</p>
  
  <pre><code>FAILED: getsCorrectContentType("application/vnd.ms-excel", docs/xls/en.xls)
  java.lang.AssertionError: expected:&lt;application/vnd.ms-excel&gt; but was:&lt;x-tika-msoffice&gt;
  
  FAILED: getsCorrectContentType("vnd.openxmlformats-officedocument.spreadsheetml.sheet", docs/xlsx/en.xlsx)
  java.lang.AssertionError: expected:&lt;vnd.openxmlformats-officedocument.spreadsheetml.sheet&gt; but was:&lt;zip&gt;
  
  FAILED: getsCorrectContentType("application/msword", doc/en.doc)
  java.lang.AssertionError: expected:&lt;application/msword&gt; but was:&lt;x-tika-msoffice&gt;
  
  FAILED: getsCorrectContentType("application/vnd.openxmlformats-officedocument.wordprocessingml.document", docs/docx/en.docx)
  java.lang.AssertionError: expected:&lt;application/vnd.openxmlformats-officedocument.wordprocessingml.document&gt; but was:&lt;zip&gt;
  
  FAILED: getsCorrectContentType("vnd.ms-powerpoint", docs/ppt/en.ppt)
  java.lang.AssertionError: expected:&lt;vnd.ms-powerpoint&gt; but was:&lt;x-tika-msoffice&gt;
  </code></pre>
  
  <p>Is there any way to get the actual subtype from mimetypes.xml ? Instead of x-tika-msoffice or application/zip ?</p>
  
  <p>Moreover I never get application/x-tika-ooxml, but application/zip for xlsx, docx, pptx documents.</p>