public static String getExtension(String contentType, TikaConfig config) throws MimeTypeException {
            MimeTypes types = config.getMimeRepository();
            MimeType mime = types.forName(contentType);
            return getExtension(mime);
        }
Utility method to convert from a string value representing a content type
(e.g. "application/pdf") into the most common extension for that file type
(e.g. "pdf").
<p>
This will has special handling for texty filetypes whose MimeTypes
don't currently return anything for {@link MimeType#getExtension};

@param contentType string representing a content type, for example: "application/pdf"
@param config      config from which to get MimeRepository
@return extension or empty string
@throws MimeTypeException thrown if MimeTypes can't parse the contentType
tika-eval/tika-eval-app/src/main/java/org/apache/tika/eval/app/db/MimeBuffer.java