Uploaded image for project: 'Tika'
  1. Tika
  2. TIKA-2554

Subtypes for common text formats currently included in text/plain

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.17
    • Fix Version/s: None
    • Component/s: mime
    • Labels:
      None

      Description

      Currently, we have a very large number of file extension globs all feeding into the text/plain mimetype. This includes not only variations on actual plain text, but also lots of other text-based formats (eg config or makefile/autoconf files). This list dates back quite a while (TIKA-85 seems to have added most of them)

      While this simplifies things in Tika, it has the downside of making it very tricky for people to add custom parsers for these text-based formats (eg https://stackoverflow.com/questions/48411421/define-a-mime-type-for-txt-files-for-tika where they want to handle .cfg differently to other .txt)

      Because of how AutoDetectParser works, as long as there's no more specific parser defined, if we create some new text/ subtypes which extend text/plain then there won't be any change in parsing behaviour. The only change would be for detection, where a more specific type would be returned

      I therefore propose that we pull some of these (file-magic-less) globs out into other text/ mimetypes with a parent of text/plan , grouped roughly by type

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              nick Nick Burch
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: