Tika
  1. Tika
  2. TIKA-483

Empty file detected as text/plain

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.7
    • Fix Version/s: 0.8
    • Component/s: None
    • Labels:
      None

      Description

      Our current type detection code returns text/plain for an empty document. A more better return type would be application/octet-stream, to give higher level detectors like filename suffix hints more flexibility.

        Activity

        Hide
        Jukka Zitting added a comment -

        Fixed in revision 986594. I use application/octet-stream for empty files instead of the non-standard application/x-empty. This loses some information, but on the other hand allows type inheritance rules to work correctly in cases like when a type hint like "filename.txt" suggests a more specific media type.

        Show
        Jukka Zitting added a comment - Fixed in revision 986594. I use application/octet-stream for empty files instead of the non-standard application/x-empty. This loses some information, but on the other hand allows type inheritance rules to work correctly in cases like when a type hint like "filename.txt" suggests a more specific media type.
        Hide
        Piotr Bartosiewicz added a comment -

        Unix 'file -i' command returns application/x-empty for an empty document.

        Show
        Piotr Bartosiewicz added a comment - Unix 'file -i' command returns application/x-empty for an empty document.

          People

          • Assignee:
            Jukka Zitting
            Reporter:
            Jukka Zitting
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development