code: protected final Metadata prepareMetadata( final Binary binary,
                                                final Context context ) throws IOException, RepositoryException {
          Metadata metadata = new Metadata();
  
          String mimeType = binary.getMimeType();
          if (StringUtil.isBlank(mimeType)) {
              // Call the detector (we don't know the name) ...
              mimeType = context.mimeTypeOf(null, binary);
          }
          if (!StringUtil.isBlank(mimeType)) {
              metadata.set(Metadata.CONTENT_TYPE, mimeType);
          }
          return metadata;
      }
docs: Creates a new tika metadata object used by the parser. This will contain the mime-type of the content being parsed, if this
  is available to the underlying context. If not, Tika's autodetection mechanism is used to try and get the mime-type.
  
  @param binary a <code>org.modeshape.jcr.api.Binary</code> instance of the content being parsed
  @param context the extraction context; may not be null
  @return a <code>Metadata</code> instance.
  @throws java.io.IOException if auto-detecting the mime-type via Tika fails
  @throws RepositoryException if error obtaining MIME-type of the binary parameter