You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "Adam Lamar (JIRA)" <ji...@apache.org> on 2015/03/01 17:53:04 UTC

[jira] [Created] (TIKA-1563) Use .gz as the default extension for application/gzip

Adam Lamar created TIKA-1563:
--------------------------------

             Summary: Use .gz as the default extension for application/gzip
                 Key: TIKA-1563
                 URL: https://issues.apache.org/jira/browse/TIKA-1563
             Project: Tika
          Issue Type: Bug
          Components: core
            Reporter: Adam Lamar
            Priority: Minor


This ticket is in reference to the following code:

MimeType mimeType = config.getMimeRepository().forName("application/gzip"); 
String extension = mimeType.getExtension();

The string extension will be ".tgz". While it is possible to get .gz or other common extensions with mimeType.getExtensions(), it would be nice if the default was .gz. Every .tgz is an application/gzip, but every application/gzip is not a .tgz. 

Note that although the code above uses the static mime type application/gzip, it is more likely that real-world code is performing mime type detection on specific files and looking up the returned type in the mime registry. Returning .gz for a gzipped tarball isn't wrong, but is less specific than its real type. However, returning .tgz for gzipped text is incorrect.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)